-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Convert command actions tests to Javascript #6647
[WIP] Convert command actions tests to Javascript #6647
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
The test failures from driver-integration-tests-firefox and server-e2e-tests-electron-3 does not seem to be related to this change. Please let me know if it is. https://app.circleci.com/jobs/github/cypress-io/cypress/272830 |
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.
I did not do a full review yet, but I see a lot of this
calls that are within arrow functions when you noted:
The remaining use of the function() notation is necessary. (Example: use of "this" keyword in the tests)
Can you re-review all uses of this
?
beforeEach(() => { | ||
cy.on('log:added', (attrs, log) => { | ||
if (log.get('name') === 'assert') { | ||
this.lastLog = log |
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.
this
with arrow functions, is this maintaining the correct this
?
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.
Yes, ditto. I've tested with a cy.log(this.lastLog)
in an existing test locally.
this.logs = [] | ||
|
||
cy.on('log:added', (attrs, log) => { | ||
this.lastLog = log | ||
|
||
this.logs.push(log) |
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.
this
with arrow functions, is this maintaining the correct this
?
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.
Yes, the cy.on('fail', (err) => ...
in the subsequent tests receives this.logs
I'd be happy to change the arrow functions back to |
Sorry, this got out of date so quickly. You're welcome to open a new PR. |
This PR consists of the command actions tests from the driver package converted to Javascript from Coffeescript. The conversion has been done via the following command:
cypress/.vscode/tasks.json
Line 15 in 844606b
I've converted the files in as few commits as possible. (bulk-decaffeinate creates commits for stages of the conversion.) Please do not squash this commit. :)
A part of #2690
User facing changelog
No user facing changelog specific to these tests should be needed.
Additional details
This PR is a part of continuous improvement in maintaining the codebase. We hope the codebase will be in Typescript. :) Javascript is an intermediate step.
I've reviewed the results of the bulk-decaffeinate command. I've ensured the following:
How has the user experience changed?
No noticeable changes should be detected by the developers and the users. The new version of the tests should work the same as the old Coffeescript ones.
PR Tasks