mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-11 01:29:59 -06:00
chore: change ct -> component, projectType -> testingType everywhere for consistency (#17461)
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
This commit is contained in:
6
cli/types/cypress.d.ts
vendored
6
cli/types/cypress.d.ts
vendored
@@ -2717,13 +2717,13 @@ declare namespace Cypress {
|
||||
* Override default config options for Component Testing runner.
|
||||
* @default {}
|
||||
*/
|
||||
component: Omit<ResolvedConfigOptions, 'e2e' | 'component'>
|
||||
component: Omit<ResolvedConfigOptions, TestingType>
|
||||
|
||||
/**
|
||||
* Override default config options for E2E Testing runner.
|
||||
* @default {}
|
||||
*/
|
||||
e2e: Omit<ResolvedConfigOptions, 'e2e' | 'component'>
|
||||
e2e: Omit<ResolvedConfigOptions, TestingType>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2809,7 +2809,7 @@ declare namespace Cypress {
|
||||
/**
|
||||
* All configuration items are optional.
|
||||
*/
|
||||
type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, 'e2e' | 'component'>>
|
||||
type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
|
||||
type ConfigOptions = CoreConfigOptions & {e2e?: CoreConfigOptions, component?: CoreConfigOptions }
|
||||
|
||||
interface PluginConfigOptions extends ResolvedConfigOptions {
|
||||
|
||||
@@ -62,7 +62,7 @@ export const SpecContent = namedObserver('SpecContent', (props: SpecContentProps
|
||||
},
|
||||
)}
|
||||
>
|
||||
<Header {...props} runner='ct' />
|
||||
<Header {...props} runner='component' />
|
||||
{props.state.spec
|
||||
? <Iframes {...props} />
|
||||
: (
|
||||
|
||||
@@ -68,7 +68,7 @@ const Runner = {
|
||||
const container = (
|
||||
<Container
|
||||
config={config}
|
||||
runner='ct'
|
||||
runner='component'
|
||||
state={state}
|
||||
App={App}
|
||||
hasSpecFile={util.hasSpecFile}
|
||||
|
||||
@@ -39,11 +39,11 @@ export class Container extends Component {
|
||||
: this._noSpec()
|
||||
}
|
||||
|
||||
if (this.props.runner === 'ct') {
|
||||
if (this.props.runner === 'component') {
|
||||
return this._app()
|
||||
}
|
||||
|
||||
throw Error(`runner prop is required and must be 'e2e' or 'ct'. You passed: ${this.props.runner}.`)
|
||||
throw Error(`runner prop is required and must be 'e2e' or 'component'. You passed: ${this.props.runner}.`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,9 +99,9 @@ export const eventManager = {
|
||||
rerun()
|
||||
})
|
||||
|
||||
ws.on('specs:changed', ({ specs, projectType }) => {
|
||||
ws.on('specs:changed', ({ specs, testingType }) => {
|
||||
// do not emit the event if e2e runner is not displaying an inline spec list.
|
||||
if (projectType === 'e2e' && state.useInlineSpecList === false) {
|
||||
if (testingType === 'e2e' && state.useInlineSpecList === false) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ interface BaseState {
|
||||
}
|
||||
|
||||
interface StateCT {
|
||||
runner: 'ct'
|
||||
runner: 'component'
|
||||
state: {
|
||||
screenshotting: boolean
|
||||
} & BaseState
|
||||
@@ -117,7 +117,7 @@ export class Header extends Component<HeaderProps> {
|
||||
className={cs({
|
||||
'showing-selector-playground': selectorPlaygroundModel.isOpen,
|
||||
'showing-studio': studioRecorder.isOpen,
|
||||
'display-none': this.props.runner === 'ct' && this.props.state.screenshotting,
|
||||
'display-none': this.props.runner === 'component' && this.props.state.screenshotting,
|
||||
})}
|
||||
>
|
||||
<div className='sel-url-wrap'>
|
||||
|
||||
@@ -18,7 +18,7 @@ const registerCheckForUpdates = () => {
|
||||
const checkForUpdates = (initialLaunch) => {
|
||||
Updater.check({
|
||||
initialLaunch,
|
||||
testingType: 'ct',
|
||||
testingType: 'component',
|
||||
onNewVersion: _.noop,
|
||||
onNoNewVersion: _.noop,
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ type WarningErr = Record<string, any>
|
||||
|
||||
export class ServerCt extends ServerBase<SocketCt> {
|
||||
open (config: Cfg, options: OpenServerOptions) {
|
||||
return super.open(config, { ...options, projectType: 'ct' })
|
||||
return super.open(config, { ...options, testingType: 'component' })
|
||||
}
|
||||
|
||||
createServer (app, config, onWarning): Bluebird<[number, WarningErr?]> {
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('index.spec', () => {
|
||||
expect(stub_setInterval.firstCall.args[1]).eq(1000 * 60 * 60)
|
||||
expect(Updater.check.callCount).eq(1)
|
||||
expect(Updater.check.firstCall.args[0]).includes({
|
||||
testingType: 'ct',
|
||||
testingType: 'component',
|
||||
initialLaunch: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -356,7 +356,7 @@ const moduleFactory = () => {
|
||||
|
||||
// store the currently open project
|
||||
openProject = new Project.ProjectBase({
|
||||
projectType: args.testingType === 'component' ? 'ct' : 'e2e',
|
||||
testingType: args.testingType === 'component' ? 'component' : 'e2e',
|
||||
projectRoot: path,
|
||||
options: {
|
||||
...options,
|
||||
|
||||
@@ -28,7 +28,7 @@ import specsUtil from './util/specs'
|
||||
import Watchers from './watchers'
|
||||
import devServer from './plugins/dev-server'
|
||||
import preprocessor from './plugins/preprocessor'
|
||||
import { RunnerType, SpecsStore } from './specs-store'
|
||||
import { SpecsStore } from './specs-store'
|
||||
import { createRoutes as createE2ERoutes } from './routes'
|
||||
import { createRoutes as createCTRoutes } from '@packages/server-ct/src/routes-ct'
|
||||
import { checkSupportFile } from './project_utils'
|
||||
@@ -83,18 +83,18 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
private _recordTests?: any = null
|
||||
|
||||
public browser: any
|
||||
public projectType: RunnerType
|
||||
public testingType: Cypress.TestingType
|
||||
public spec: Cypress.Cypress['spec'] | null
|
||||
private generatedProjectIdTimestamp: any
|
||||
projectRoot: string
|
||||
|
||||
constructor ({
|
||||
projectRoot,
|
||||
projectType,
|
||||
testingType,
|
||||
options,
|
||||
}: {
|
||||
projectRoot: string
|
||||
projectType: RunnerType
|
||||
testingType: Cypress.TestingType
|
||||
options: Options
|
||||
}) {
|
||||
super()
|
||||
@@ -107,14 +107,14 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
throw new Error(`Expected project root path, not ${projectRoot}`)
|
||||
}
|
||||
|
||||
this.projectType = projectType
|
||||
this.testingType = testingType
|
||||
this.projectRoot = path.resolve(projectRoot)
|
||||
this.watchers = new Watchers()
|
||||
this.spec = null
|
||||
this.browser = null
|
||||
|
||||
debug('Project created %o', {
|
||||
projectType: this.projectType,
|
||||
testingType: this.testingType,
|
||||
projectRoot: this.projectRoot,
|
||||
})
|
||||
|
||||
@@ -168,8 +168,8 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
}
|
||||
}
|
||||
|
||||
createServer (projectType: RunnerType) {
|
||||
return projectType === 'e2e'
|
||||
createServer (testingType: Cypress.TestingType) {
|
||||
return testingType === 'e2e'
|
||||
? new ServerE2E() as TServer
|
||||
: new ServerCt() as TServer
|
||||
}
|
||||
@@ -192,7 +192,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
await scaffold.plugins(path.dirname(cfg.pluginsFile), cfg)
|
||||
}
|
||||
|
||||
this._server = this.createServer(this.projectType)
|
||||
this._server = this.createServer(this.testingType)
|
||||
|
||||
cfg = await this.initializePlugins(cfg, this.options)
|
||||
|
||||
@@ -202,7 +202,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
ctDevServerPort,
|
||||
} = await this.initializeSpecStore(cfg)
|
||||
|
||||
if (this.projectType === 'ct') {
|
||||
if (this.testingType === 'component') {
|
||||
cfg.baseUrl = `http://localhost:${ctDevServerPort}`
|
||||
}
|
||||
|
||||
@@ -212,9 +212,9 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
onError: this.options.onError,
|
||||
onWarning: this.options.onWarning,
|
||||
shouldCorrelatePreRequests: this.shouldCorrelatePreRequests,
|
||||
projectType: this.projectType as 'ct' | 'e2e',
|
||||
SocketCtor: this.projectType === 'e2e' ? SocketE2E : SocketCt,
|
||||
createRoutes: this.projectType === 'e2e' ? createE2ERoutes : createCTRoutes,
|
||||
testingType: this.testingType,
|
||||
SocketCtor: this.testingType === 'e2e' ? SocketE2E : SocketCt,
|
||||
createRoutes: this.testingType === 'e2e' ? createE2ERoutes : createCTRoutes,
|
||||
specsStore,
|
||||
})
|
||||
|
||||
@@ -333,7 +333,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
this.spec = null
|
||||
this.browser = null
|
||||
|
||||
const closePreprocessor = (this.projectType === 'e2e' && preprocessor.close) ?? undefined
|
||||
const closePreprocessor = (this.testingType === 'e2e' && preprocessor.close) ?? undefined
|
||||
|
||||
await Promise.all([
|
||||
this.server?.close(),
|
||||
@@ -365,15 +365,15 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
}> {
|
||||
const allSpecs = await specsUtil.find(updatedConfig)
|
||||
const specs = allSpecs.filter((spec: Cypress.Cypress['spec']) => {
|
||||
if (this.projectType === 'ct') {
|
||||
if (this.testingType === 'component') {
|
||||
return spec.specType === 'component'
|
||||
}
|
||||
|
||||
if (this.projectType === 'e2e') {
|
||||
if (this.testingType === 'e2e') {
|
||||
return spec.specType === 'integration'
|
||||
}
|
||||
|
||||
throw Error(`Cannot return specType for projectType: ${this.projectType}`)
|
||||
throw Error(`Cannot return specType for testingType: ${this.testingType}`)
|
||||
})
|
||||
|
||||
return this.initSpecStore({ specs, config: updatedConfig })
|
||||
@@ -422,16 +422,16 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
specs: Cypress.Cypress['spec'][]
|
||||
config: any
|
||||
}) {
|
||||
const specsStore = new SpecsStore(config, this.projectType as RunnerType)
|
||||
const specsStore = new SpecsStore(config, this.testingType)
|
||||
|
||||
const startSpecWatcher = () => {
|
||||
return specsStore.watch({
|
||||
onSpecsChanged: (specs) => {
|
||||
// both e2e and CT watch the specs and send them to the
|
||||
// client to be shown in the SpecList.
|
||||
this.server.sendSpecList(specs, this.projectType as RunnerType)
|
||||
this.server.sendSpecList(specs, this.testingType)
|
||||
|
||||
if (this.projectType === 'ct') {
|
||||
if (this.testingType === 'component') {
|
||||
// ct uses the dev-server to build and bundle the speces.
|
||||
// send new files to dev server
|
||||
devServer.updateSpecs(specs)
|
||||
@@ -442,7 +442,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
|
||||
let ctDevServerPort: number | undefined
|
||||
|
||||
if (this.projectType === 'ct') {
|
||||
if (this.testingType === 'component') {
|
||||
const { port } = await this.startCtDevServer(specs, config)
|
||||
|
||||
ctDevServerPort = port
|
||||
@@ -677,7 +677,7 @@ export class ProjectBase<TServer extends ServerE2E | ServerCt> extends EE {
|
||||
})
|
||||
}
|
||||
|
||||
theCfg = this.projectType === 'e2e'
|
||||
theCfg = this.testingType === 'e2e'
|
||||
? theCfg
|
||||
: this.injectCtSpecificConfig(theCfg)
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ export async function add (path, options) {
|
||||
}
|
||||
|
||||
export function getId (path) {
|
||||
return new ProjectBase({ projectRoot: path, projectType: 'e2e', options: {} }).getProjectId()
|
||||
return new ProjectBase({ projectRoot: path, testingType: 'e2e', options: {} }).getProjectId()
|
||||
}
|
||||
|
||||
export function ensureExists (path, options) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import origin from './util/origin'
|
||||
import { allowDestroy, DestroyableHttpServer } from './util/server_destroy'
|
||||
import { SocketAllowed } from './util/socket_allowed'
|
||||
import { createInitialWorkers } from '@packages/rewriter'
|
||||
import { RunnerType, SpecsStore } from './specs-store'
|
||||
import { SpecsStore } from './specs-store'
|
||||
import { InitializeRoutes } from '../../server-ct/src/routes-ct'
|
||||
import { Cfg } from './project-base'
|
||||
import { Browser } from '@packages/server/lib/browsers/types'
|
||||
@@ -94,7 +94,7 @@ export type WarningErr = Record<string, any>
|
||||
export interface OpenServerOptions {
|
||||
SocketCtor: typeof SocketE2E | typeof SocketCt
|
||||
specsStore: SpecsStore
|
||||
projectType: 'ct' | 'e2e'
|
||||
testingType: Cypress.TestingType
|
||||
onError: any
|
||||
onWarning: any
|
||||
getCurrentBrowser: () => Browser
|
||||
@@ -175,7 +175,7 @@ export abstract class ServerBase<TSocket extends SocketE2E | SocketCt> {
|
||||
shouldCorrelatePreRequests,
|
||||
specsStore,
|
||||
createRoutes,
|
||||
projectType,
|
||||
testingType,
|
||||
SocketCtor,
|
||||
}: OpenServerOptions) {
|
||||
debug('server open')
|
||||
@@ -183,7 +183,7 @@ export abstract class ServerBase<TSocket extends SocketE2E | SocketCt> {
|
||||
la(_.isPlainObject(config), 'expected plain config object', config)
|
||||
|
||||
return Bluebird.try(() => {
|
||||
if (!config.baseUrl && projectType === 'ct') {
|
||||
if (!config.baseUrl && testingType === 'component') {
|
||||
throw new Error('ServerCt#open called without config.baseUrl.')
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ export abstract class ServerBase<TSocket extends SocketE2E | SocketCt> {
|
||||
logger.setSettings(config)
|
||||
|
||||
this._nodeProxy = httpProxy.createProxyServer({
|
||||
target: config.baseUrl && projectType === 'ct' ? config.baseUrl : undefined,
|
||||
target: config.baseUrl && testingType === 'component' ? config.baseUrl : undefined,
|
||||
})
|
||||
|
||||
this._socket = new SocketCtor(config) as TSocket
|
||||
@@ -604,7 +604,7 @@ export abstract class ServerBase<TSocket extends SocketE2E | SocketCt> {
|
||||
return this.httpsProxy.connect(req, socket, head)
|
||||
}
|
||||
|
||||
sendSpecList (specs: Cypress.Cypress['spec'][], projectType: RunnerType) {
|
||||
return this.socket.sendSpecList(specs, projectType)
|
||||
sendSpecList (specs: Cypress.Cypress['spec'][], testingType: Cypress.TestingType) {
|
||||
return this.socket.sendSpecList(specs, testingType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export class ServerE2E extends ServerBase<SocketE2E> {
|
||||
}
|
||||
|
||||
open (config: Cfg, options: OpenServerOptions) {
|
||||
return super.open(config, { ...options, projectType: 'e2e' })
|
||||
return super.open(config, { ...options, testingType: 'e2e' })
|
||||
}
|
||||
|
||||
createServer (app, config, onWarning): Bluebird<[number, WarningErr?]> {
|
||||
|
||||
@@ -14,7 +14,6 @@ import { getUserEditor, setUserEditor } from './util/editors'
|
||||
import { openFile } from './util/file-opener'
|
||||
import open from './util/open'
|
||||
import { DestroyableHttpServer } from './util/server_destroy'
|
||||
import { RunnerType } from './specs-store'
|
||||
|
||||
type StartListeningCallbacks = {
|
||||
onSocketConnection: (socket: any) => void
|
||||
@@ -484,7 +483,7 @@ export class SocketBase {
|
||||
return this.io.close()
|
||||
}
|
||||
|
||||
sendSpecList (specs, projectType: RunnerType) {
|
||||
this.toRunner('specs:changed', { specs, projectType })
|
||||
sendSpecList (specs, testingType: Cypress.TestingType) {
|
||||
this.toRunner('specs:changed', { specs, testingType })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,15 +15,13 @@ const COMMON_SEARCH_OPTIONS = ['fixturesFolder', 'supportFile', 'projectRoot', '
|
||||
// TODO: shouldn't this be on the trailing edge, not leading?
|
||||
const debounce = (fn) => _.debounce(fn, 250, { leading: true })
|
||||
|
||||
export type RunnerType = 'ct' | 'e2e'
|
||||
|
||||
export class SpecsStore {
|
||||
watcher: FSWatcher | null = null
|
||||
specFiles: SpecFiles = []
|
||||
|
||||
constructor (
|
||||
private cypressConfig: Record<string, any>,
|
||||
private runner: RunnerType,
|
||||
private runner: Cypress.TestingType,
|
||||
) {}
|
||||
|
||||
get specDirectory () {
|
||||
@@ -31,7 +29,7 @@ export class SpecsStore {
|
||||
return this.cypressConfig.resolved.integrationFolder.value
|
||||
}
|
||||
|
||||
if (this.runner === 'ct') {
|
||||
if (this.runner === 'component') {
|
||||
return this.cypressConfig.resolved.componentFolder.value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ describe('lib/cypress', () => {
|
||||
}).then(() => {
|
||||
expect(api.createProject).not.to.be.called
|
||||
|
||||
return (new ProjectBase({ projectRoot: this.noScaffolding, projectType: 'e2e' })).getProjectId()
|
||||
return (new ProjectBase({ projectRoot: this.noScaffolding, testingType: 'e2e' })).getProjectId()
|
||||
.then(() => {
|
||||
throw new Error('should have caught error but did not')
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -128,7 +128,7 @@ describe('Routes', () => {
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
this.project = new ProjectBase({ projectRoot: '/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/path/to/project-e2e', testingType: 'e2e' })
|
||||
|
||||
cfg.pluginsFile = false
|
||||
|
||||
@@ -145,7 +145,7 @@ describe('Routes', () => {
|
||||
getCurrentBrowser: () => null,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
createRoutes,
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
.spread(async (port) => {
|
||||
const automationStub = {
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('Server', () => {
|
||||
SocketCtor: SocketE2E,
|
||||
createRoutes,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
.spread(async (port) => {
|
||||
const automationStub = {
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('Web Sockets', () => {
|
||||
SocketCtor: SocketE2E,
|
||||
createRoutes,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
.then(async () => {
|
||||
const automationStub = {
|
||||
|
||||
@@ -357,7 +357,7 @@ describe('Proxy Performance', function () {
|
||||
SocketCtor: SocketE2E,
|
||||
createRoutes,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ const ProjectStatic = require(`${root}../lib/project_static`)
|
||||
|
||||
describe('lib/modes/run', () => {
|
||||
beforeEach(function () {
|
||||
this.projectInstance = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.projectInstance = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
})
|
||||
|
||||
context('.getProjectId', () => {
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('lib/project-base', () => {
|
||||
return config.set({ projectName: 'project', projectRoot: '/foo/bar' })
|
||||
.then((config1) => {
|
||||
this.config = config1
|
||||
this.project = new ProjectBase({ projectRoot: this.todosPath, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: this.todosPath, testingType: 'e2e' })
|
||||
this.project._server = { close () {} }
|
||||
this.project._cfg = config1
|
||||
})
|
||||
@@ -81,7 +81,7 @@ describe('lib/project-base', () => {
|
||||
})
|
||||
|
||||
it('always resolves the projectRoot to be absolute', function () {
|
||||
const p = new ProjectBase({ projectRoot: '../foo/bar', projectType: 'e2e' })
|
||||
const p = new ProjectBase({ projectRoot: '../foo/bar', testingType: 'e2e' })
|
||||
|
||||
expect(p.projectRoot).not.to.eq('../foo/bar')
|
||||
expect(p.projectRoot).to.eq(path.resolve('../foo/bar'))
|
||||
@@ -91,7 +91,7 @@ describe('lib/project-base', () => {
|
||||
sinon.stub(ServerE2E.prototype, 'open').resolves([])
|
||||
sinon.stub(ProjectBase.prototype, 'startCtDevServer').resolves({ port: 9999 })
|
||||
|
||||
const projectCt = new ProjectBase({ projectRoot: '../foo/bar', projectType: 'ct' })
|
||||
const projectCt = new ProjectBase({ projectRoot: '../foo/bar', testingType: 'component' })
|
||||
|
||||
await projectCt.initializeConfig()
|
||||
|
||||
@@ -472,7 +472,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#close', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
|
||||
this.project._server = { close () {} }
|
||||
|
||||
@@ -533,7 +533,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#reset', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
this.project._automation = { reset: sinon.stub() }
|
||||
this.project._server = { close () {}, reset: sinon.stub() }
|
||||
})
|
||||
@@ -548,7 +548,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#getRuns', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
sinon.stub(settings, 'read').resolves({ projectId: 'id-123' })
|
||||
sinon.stub(api, 'getProjectRuns').resolves('runs')
|
||||
sinon.stub(user, 'ensureAuthToken').resolves('auth-token-123')
|
||||
@@ -565,7 +565,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#scaffold', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
sinon.stub(scaffold, 'integration').resolves()
|
||||
sinon.stub(scaffold, 'fixture').resolves()
|
||||
sinon.stub(scaffold, 'support').resolves()
|
||||
@@ -651,7 +651,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#watchSettings', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
this.project._server = { close () {}, startWebsockets () {} }
|
||||
sinon.stub(settings, 'pathToConfigFile').returns('/path/to/cypress.json')
|
||||
sinon.stub(settings, 'pathToCypressEnvJson').returns('/path/to/cypress.env.json')
|
||||
@@ -711,7 +711,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
context('#watchPluginsFile', () => {
|
||||
beforeEach(function () {
|
||||
sinon.stub(fs, 'pathExists').resolves(true)
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
this.project.watchers = { watchTree: sinon.spy() }
|
||||
sinon.stub(plugins, 'init').resolves()
|
||||
|
||||
@@ -783,7 +783,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#startWebsockets', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
this.project.watchers = {}
|
||||
this.project._server = { close () {}, startWebsockets: sinon.stub() }
|
||||
sinon.stub(ProjectBase.prototype, 'open').resolves()
|
||||
@@ -815,7 +815,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#getProjectId', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
this.verifyExistence = sinon.stub(ProjectBase.prototype, 'verifyExistence').resolves()
|
||||
})
|
||||
|
||||
@@ -879,7 +879,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#writeProjectId', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: '/_test-output/path/to/project-e2e', testingType: 'e2e' })
|
||||
|
||||
sinon.stub(settings, 'write')
|
||||
.withArgs(this.project.projectRoot, { projectId: 'id-123' })
|
||||
@@ -957,7 +957,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
const projectRoot = '/_test-output/path/to/project-e2e'
|
||||
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot, testingType: 'e2e' })
|
||||
this.newProject = { id: 'project-id-123' }
|
||||
|
||||
sinon.stub(user, 'ensureAuthToken').resolves('auth-token-123')
|
||||
@@ -990,7 +990,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
context('#getRecordKeys', () => {
|
||||
beforeEach(function () {
|
||||
this.recordKeys = []
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
sinon.stub(settings, 'read').resolves({ projectId: 'id-123' })
|
||||
sinon.stub(user, 'ensureAuthToken').resolves('auth-token-123')
|
||||
sinon.stub(api, 'getProjectRecordKeys').resolves(this.recordKeys)
|
||||
@@ -1011,7 +1011,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
|
||||
context('#requestAccess', () => {
|
||||
beforeEach(function () {
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
this.project = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
sinon.stub(user, 'ensureAuthToken').resolves('auth-token-123')
|
||||
sinon.stub(api, 'requestAccess').resolves('response')
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('lib/scaffold', () => {
|
||||
})
|
||||
|
||||
it('is true when integrationFolder is empty', function () {
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
|
||||
return pristine.initializeConfig()
|
||||
.then(() => {
|
||||
@@ -39,7 +39,7 @@ describe('lib/scaffold', () => {
|
||||
it('is false when integrationFolder has been changed', function () {
|
||||
const pristine = new ProjectBase({
|
||||
projectRoot: this.pristinePath,
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
options: {
|
||||
integrationFolder: 'foo',
|
||||
},
|
||||
@@ -57,7 +57,7 @@ describe('lib/scaffold', () => {
|
||||
const id = () => {
|
||||
const idsPath = Fixtures.projectPath('ids')
|
||||
|
||||
this.ids = new ProjectBase({ projectRoot: idsPath, projectType: 'e2e' })
|
||||
this.ids = new ProjectBase({ projectRoot: idsPath, testingType: 'e2e' })
|
||||
|
||||
return this.ids.initializeConfig()
|
||||
.then(() => {
|
||||
@@ -72,7 +72,7 @@ describe('lib/scaffold', () => {
|
||||
const todo = () => {
|
||||
const todosPath = Fixtures.projectPath('todos')
|
||||
|
||||
this.todos = new ProjectBase({ projectRoot: todosPath, projectType: 'e2e' })
|
||||
this.todos = new ProjectBase({ projectRoot: todosPath, testingType: 'e2e' })
|
||||
|
||||
return this.todos.initializeConfig()
|
||||
.then(() => {
|
||||
@@ -88,7 +88,7 @@ describe('lib/scaffold', () => {
|
||||
})
|
||||
|
||||
it('is true when files, name + bytes match to scaffold', function () {
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
|
||||
return pristine.initializeConfig()
|
||||
.then(() => {
|
||||
@@ -101,7 +101,7 @@ describe('lib/scaffold', () => {
|
||||
})
|
||||
|
||||
it('is false when bytes dont match scaffold', function () {
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, projectType: 'e2e' })
|
||||
const pristine = new ProjectBase({ projectRoot: this.pristinePath, testingType: 'e2e' })
|
||||
|
||||
return pristine.initializeConfig()
|
||||
.then(() => {
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('lib/socket', () => {
|
||||
SocketCtor: SocketE2E,
|
||||
createRoutes,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
.then(() => {
|
||||
this.options = {
|
||||
@@ -567,7 +567,7 @@ describe('lib/socket', () => {
|
||||
SocketCtor: SocketE2E,
|
||||
createRoutes,
|
||||
specsStore: new SpecsStore({}, 'e2e'),
|
||||
projectType: 'e2e',
|
||||
testingType: 'e2e',
|
||||
})
|
||||
.then(() => {
|
||||
this.automation = new Automation(this.cfg.namespace, this.cfg.socketIoCookie, this.cfg.screenshotsFolder)
|
||||
|
||||
Reference in New Issue
Block a user