Skip to content

Add test skip capability#250

Merged
dangood84 merged 4 commits intomainfrom
add-test-skip-capability
Apr 20, 2023
Merged

Add test skip capability#250
dangood84 merged 4 commits intomainfrom
add-test-skip-capability

Conversation

@cshnimble
Copy link
Copy Markdown
Contributor

Adds a Cypress command to enable test skips when conditions are met.

The command is in support/commands.js and will take any boolean expression as an arg.

Note: to be able to use it and use the Mocha test context, any test will need to use es5 syntax for functions, namely:

it('does a thing', function () { //do something })

rather than

it('does a thing', () => { //do something })

In the skipped tests, I'm currently evaluating against the url containing 'dev' to skip on dev environment, but you may want to change the expression if this won't work.

Also fixes formatting in test classes.

@dangood84
Copy link
Copy Markdown
Contributor

Adds a Cypress command to enable test skips when conditions are met.

The command is in support/commands.js and will take any boolean expression as an arg.

Note: to be able to use it and use the Mocha test context, any test will need to use es5 syntax for functions, namely:

it('does a thing', function () { //do something })

rather than

it('does a thing', () => { //do something })

In the skipped tests, I'm currently evaluating against the url containing 'dev' to skip on dev environment, but you may want to change the expression if this won't work.

Also fixes formatting in test classes.

Hey @cshnimble , Looks good to me. Thanks for also making some other best-practice amendments to my original code.

I think the only thing from me is to please ask nicely if you can switch testing for 'dev' or 'test' in the URL is for now to test for 'd01' or 't01' to select the appropriate environment?

Other than that all good from me boss unless you've got anything else to add @paullocknimble ?

Thanks

Copy link
Copy Markdown
Contributor

@dangood84 dangood84 left a comment

Choose a reason for hiding this comment

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

Hey boss, Thanks a million for the amendments Chris. Please can you switch 'dev' to 'd01' and 'test' to 't01' if that's ok please boss?

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@cshnimble cshnimble requested a review from dangood84 April 20, 2023 15:10
@dangood84 dangood84 merged commit e028b70 into main Apr 20, 2023
@dangood84 dangood84 deleted the add-test-skip-capability branch April 20, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants