Skip to content
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

Update HTML examples to conform to scaffolded tests #804

Closed
cacieprins opened this issue Mar 14, 2024 · 10 comments · Fixed by #807
Closed

Update HTML examples to conform to scaffolded tests #804

cacieprins opened this issue Mar 14, 2024 · 10 comments · Fixed by #807
Labels

Comments

@cacieprins
Copy link

The HTML that gets deployed to example.cypress.io for, e.g., commands, should align with the tests that get scaffolded from cypress/*

@MikeMcC399
Copy link
Contributor

@cacieprins

The HTML that gets deployed to example.cypress.io for, e.g., commands, should align with the tests that get scaffolded from cypress/*

Is this an issue for this repo or for the build and deploy process defined in https://github.com/cypress-io/cypress/tree/develop/packages/example ?

@jennifer-shehane
Copy link
Member

@MikeMcC399 It's an issue with this repo. This PR updated the test files: https://github.com/cypress-io/cypress-example-kitchensink/pull/802/files but there is HTML that reflects the code in the test files that should be updated. https://example.cypress.io/commands/actions

Screenshot 2024-03-14 at 12 21 51 PM

@MikeMcC399
Copy link
Contributor

@jennifer-shehane

Thanks for explaining. I see that now that you've provided the details. 👍🏻

@MikeMcC399
Copy link
Contributor

Perhaps @rubysolo would like to follow up with a related PR to change the HTML to match the tests?

For instance, the following would need to be aligned:

// .type() with special character sequences
.type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
.type('{del}{selectall}{backspace}')
// .type() with key modifiers
.type('{alt}{option}') //these are equivalent
.type('{ctrl}{control}') //these are equivalent
.type('{meta}{command}{cmd}') //these are equivalent
.type('{shift}')

// .type() with special character sequences
cy.get('.action-email').type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
cy.get('.action-email').type('{del}{selectall}{backspace}')
// .type() with key modifiers
cy.get('.action-email').type('{alt}{option}') //these are equivalent
cy.get('.action-email').type('{ctrl}{control}') //these are equivalent
cy.get('.action-email').type('{meta}{command}{cmd}') //these are equivalent
cy.get('.action-email').type('{shift}')

@rubysolo
Copy link
Contributor

Oh, I assumed those were generated. Would there be any interest in templatizing the example HTML files so that they could be autogenerated from the examples with a script?

@jennifer-shehane
Copy link
Member

@rubysolo We don't update these examples very often honestly, so I don't think there'd be a lot of utility with that.

@rubysolo
Copy link
Contributor

One question I had -- the tests no longer call end, since click isn't chainable. Is there a better example of using end that we could use in the tests / docs?

@MikeMcC399
Copy link
Contributor

@rubysolo

One question I had -- the tests no longer call end, since click isn't chainable. Is there a better example of using end that we could use in the tests / docs?

Apparently nobody noticed that the .end test had been deactivated. Although that achieved the goal of passing linting, it was at the expense of no longer demonstrating cy.end.

I've raised the following interrelated issues accordingly:

@jennifer-shehane
Copy link
Member

I'd be in favor of removing the .end example I think.

@cypress-app-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 2.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants