Skip to content

Commit

Permalink
fix: Added types for runtime config. (#14584)
Browse files Browse the repository at this point in the history
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
  • Loading branch information
sainthkh and jennifer-shehane authored Jan 20, 2021
1 parent 9216f05 commit 012d58c
Showing 1 changed file with 105 additions and 1 deletion.
106 changes: 105 additions & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ declare namespace Cypress {
// {defaultCommandTimeout: 10000, pageLoadTimeout: 30000, ...}
```
*/
config(): ResolvedConfigOptions
config(): ResolvedConfigOptions & RuntimeConfigOptions
/**
* Returns one configuration value.
* @see https://on.cypress.io/config
Expand Down Expand Up @@ -2614,6 +2614,110 @@ declare namespace Cypress {
includeShadowDom: boolean
}

/**
* Options appended to config object on runtime.
*/
interface RuntimeConfigOptions {
/**
* CPU architecture, from Node `os.arch()`
*
* @see https://nodejs.org/api/os.html#os_os_arch
*/
arch: string
/**
* The list of hosts to be blocked
*/
blockHosts: null | string | string[]
/**
* The browser Cypress is running on.
*/
browser: Browser
/**
* Available browsers found on your system.
*/
browsers: Browser[]
/**
* Path to folder containing component test files.
*/
componentFolder: string
/**
* Whether component testing is enabled.
*/
experimentalComponentTesting: boolean
/**
* Hosts mappings to IP addresses.
*/
hosts: null | string[]
/**
* Whether Cypress was launched via 'cypress open' (interactive mode)
*/
isInteractive: boolean
/**
* Whether Cypress will search for and replace
* obstructive JS code in .js or .html files.
*
* @see https://on.cypress.io/configuration#modifyObstructiveCode
*/
modifyObstructiveCode: boolean
/**
* The platform Cypress is running on.
*/
platform: 'linux' | 'darwin' | 'win32'
/**
* A unique ID for the project used for recording
*/
projectId: null | string
/**
* Path to the support folder.
*/
supportFolder: string
/**
* Glob pattern to determine what test files to load.
*/
testFiles: string
/**
* The user agent the browser sends in all request headers.
*/
userAgent: null | string
/**
* The Cypress version being used.
*/
version: string

// Internal or Unlisted at server/lib/config_options
autoOpen: boolean
browserUrl: string
clientRoute: string
configFile: string
cypressEnv: string
integrationExampleName: string
integrationExamplePath: string
isNewProject: boolean
isTextTerminal: boolean
morgan: boolean
namespace: string
parentTestsFolder: string
parentTestsFolderDisplay: string
projectName: string
projectRoot: string
proxyUrl: string
report: boolean
reporterRoute: string
reporterUrl: string
socketId: null | string
socketIoCookie: string
socketIoRoute: string
spec: {
absolute: string
name: string
relative: string
specFilter: null | string
specType: 'integration' | 'component'
}
xhrRoute: string
xhrUrl: string
}

interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'baseUrl' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>> {
browser?: IsBrowserMatcher | IsBrowserMatcher[]
}
Expand Down

4 comments on commit 012d58c

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 012d58c Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.3.1/circle-develop-012d58c228851b089d04efe5bf9834c83e0c198d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 012d58c Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.3.1/appveyor-develop-012d58c228851b089d04efe5bf9834c83e0c198d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 012d58c Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.3.1/appveyor-develop-012d58c228851b089d04efe5bf9834c83e0c198d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 012d58c Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.3.1/circle-develop-012d58c228851b089d04efe5bf9834c83e0c198d/cypress.tgz

Please sign in to comment.