Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature-multidomain
- Loading branch information
Showing
23 changed files
with
761 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { $Command } from '../cypress/command' | ||
import $errUtils from '../cypress/error_utils' | ||
|
||
export default (Cypress, userOptions: Cypress.LogGroup.Config, fn: Cypress.LogGroup.ApiCallback) => { | ||
const cy = Cypress.cy | ||
|
||
const shouldEmitLog = userOptions.log === undefined ? true : userOptions.log | ||
|
||
const options: Cypress.InternalLogConfig = { | ||
...userOptions, | ||
instrument: 'command', | ||
groupStart: true, | ||
emitOnly: !shouldEmitLog, | ||
} | ||
|
||
const log = Cypress.log(options) | ||
|
||
if (!_.isFunction(fn)) { | ||
$errUtils.throwErrByPath('group.missing_fn', { onFail: log }) | ||
} | ||
|
||
// An internal command is inserted to create a divider between | ||
// commands inside group() callback and commands chained to it. | ||
const restoreCmdIndex = cy.state('index') + 1 | ||
|
||
const endLogGroupCmd = $Command.create({ | ||
name: 'end-logGroup', | ||
injected: true, | ||
}) | ||
|
||
const forwardYieldedSubject = () => { | ||
if (log) { | ||
log.endGroup() | ||
} | ||
|
||
return endLogGroupCmd.get('prev').get('subject') | ||
} | ||
|
||
cy.queue.insert(restoreCmdIndex, endLogGroupCmd.set('fn', forwardYieldedSubject)) | ||
|
||
return fn(log) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// The type declarations for Cypress Log Group & the corresponding configuration permutations | ||
declare namespace Cypress { | ||
declare namespace LogGroup { | ||
type ApiCallback = (log: Cypress.Log) => Chainable<S> | ||
type LogGroup = (cypress: Cypress.Cypress, options: Partial<LogGroupConfig>, callback: LogGroupCallback) => Chainable<S> | ||
|
||
interface Config { | ||
// the JQuery element for the command. This will highlight the command | ||
// in the main window when debugging | ||
$el?: JQuery | ||
// whether or not to emit a log to the UI | ||
// when disabled, child logs will not be nested in the UI | ||
log?: boolean | ||
// name of the group - defaults to current command's name | ||
name?: string | ||
// additional information to include in the log | ||
message?: string | ||
// timeout of the group command - defaults to defaultCommandTimeout | ||
timeout?: number | ||
// the type of log | ||
// system - log generated by Cypress | ||
// parent - log generated by Command | ||
// child - log generated by Chained Command | ||
type?: Cypress.InternalLogConfig['type'] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// The type declarations for Cypress Logs & the corresponding configuration permutations | ||
declare namespace Cypress { | ||
interface Cypress { | ||
log(options: Partial<LogConfig | InternalLogConfig>): Log | undefined | ||
} | ||
|
||
interface Log extends Log { | ||
set<K extends keyof LogConfig | InternalLogConfig>(key: K, value: LogConfig[K]): InternalLog | ||
set(options: Partial<LogConfig | InternalLogConfig>) | ||
groupEnd(): void | ||
} | ||
|
||
type ReferenceAlias = { | ||
cardinal: number, | ||
name: string, | ||
ordinal: string, | ||
} | ||
|
||
type Snapshot = { | ||
body?: {get: () => any}, | ||
htmlAttrs?: {[key: string]: any}, | ||
name?: string | ||
} | ||
|
||
type ConsoleProps = { | ||
Command?: string | ||
Snapshot?: string | ||
Elements?: number | ||
Selector?: string | ||
Yielded?: HTMLElement | ||
Event?: string | ||
Message?: string | ||
actual?: any | ||
expected?: any | ||
} | ||
|
||
type RenderProps = { | ||
indicator?: 'aborted' | 'pending' | 'successful' | 'bad' | ||
message?: string | ||
} | ||
|
||
interface InternalLogConfig { | ||
// the JQuery element for the command. This will highlight the command | ||
// in the main window when debugging | ||
$el?: JQuery | string | ||
alias?: string | ||
aliasType?: 'agent' | 'route' | 'primitive' | 'dom' | undefined | ||
browserPreRequest?: any | ||
callCount?: number | ||
chainerId?: string | ||
commandName?: string | ||
// provide the content to display in the dev tool's console when a log is | ||
// clicked from the Reporter's Command Log | ||
consoleProps?: () => Command | Command | ||
coords?: { | ||
left: number | ||
leftCenter: number | ||
top: number | ||
topCenter: number | ||
x: number | ||
y: number | ||
} | ||
count?: number | ||
// the name override for display purposes only | ||
displayName?: string | ||
// whether or not to show the log in the Reporter UI or only | ||
// store the log details on the command and log manager | ||
emitOnly?: boolean | ||
end?: boolean | ||
ended?: boolean | ||
err?: Error | ||
error?: Error | ||
// whether or not the generated log was an event or command | ||
event?: boolean | ||
expected?: string | ||
functionName?: string | ||
// whether or not to start a new log group | ||
groupStart?: boolean | ||
hookId?: number | ||
id?: string | ||
// defaults to command | ||
instrument?: 'agent' | 'command' | 'route' | ||
// whether or not the xhr route had a corresponding response stubbed out | ||
isStubbed?: boolean | ||
// additional information to include in the log if not overridden | ||
// the render props message | ||
// defaults to command arguments for command instrument | ||
message?: string | Array<string> | any[] | ||
method?: string | ||
// name of the log | ||
name?: string | ||
numElements?: number | ||
// the number of xhr responses that occurred. This is only applicable to | ||
// logs defined with instrument=route | ||
numResponses?: number | ||
referencesAlias?: ReferenceAlias[] | ||
renderProps?: () => RenderProps | RenderProps | ||
response?: string | object | ||
selector?: any | ||
snapshot?: boolean | ||
snapshots?: [] | ||
state?: "failed" | "passed" | "pending" // representative of Mocha.Runnable.constants (not publicly exposed by Mocha types) | ||
status?: number | ||
testCurrentRetry?: number | ||
testId?: string | ||
// timeout of the group command - defaults to defaultCommandTimeout | ||
timeout?: number | ||
// the type of log | ||
// system - log generated by Cypress | ||
// parent - log generated by Command | ||
// child - log generated by Chained Command | ||
type?: 'system' | 'parent' | 'child' | ((current: State['state']['current'], subject: State['state']['subject']) => 'parent' | 'child') | ||
url?: string | ||
viewportHeight?: number | ||
viewportWidth?: number | ||
visible?: boolean | ||
wallClockStartedAt?: string | ||
} | ||
} |
Oops, something went wrong.
0772f85
There was a problem hiding this comment.
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:
0772f85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle 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: