Skip to content

fix: disable ct testing when run via binary#21540

Merged
ZachJW34 merged 7 commits into
10.0-releasefrom
zachw/disable-ct-not-cli
May 20, 2022
Merged

fix: disable ct testing when run via binary#21540
ZachJW34 merged 7 commits into
10.0-releasefrom
zachw/disable-ct-not-cli

Conversation

@ZachJW34
Copy link
Copy Markdown
Contributor

@ZachJW34 ZachJW34 commented May 17, 2022

User facing changelog

Disable CT Testing when invoked from the binary

Additional details

CT Testing requires the binary to be invoked from the cli due to the need to source the user's node_module dependencies. If the project is not invoked from the cli, we will now disable the option for the user to choose CT Testing from the page.

I did a small refactor of the testing type status. Since we are now adding another one (disabled), the attributes were getting hard to manage. I also had to make some changes to the Card.vue component as it had pointer-events-none when disabled which was preventing the link from being clicked.

How has the user experience changed?

Screen.Recording.2022-05-17.at.5.07.18.PM.mov

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@ZachJW34 ZachJW34 requested a review from tgriesser as a code owner May 17, 2022 22:09
@cypress-bot
Copy link
Copy Markdown
Contributor

cypress-bot Bot commented May 17, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link
Copy Markdown

cypress Bot commented May 17, 2022



Test summary

37456 0 454 0Flakiness 3


Run details

Project cypress
Status Passed
Commit 901d179
Started May 20, 2022 3:16 PM
Ended May 20, 2022 3:36 PM
Duration 19:40 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

e2e/origin/commands/assertions.cy.ts Flakiness
1 cy.origin assertions > #consoleProps > .should() and .and()
commands/actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
2 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Copy Markdown
Member

@tgriesser tgriesser left a comment

Choose a reason for hiding this comment

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

Change seems fine to me - based on the test failures I'm assuming there's something else in the e2e setup layer that needs to be adjusted to make this work?

@ZachJW34
Copy link
Copy Markdown
Contributor Author

@tgriesser thanks for pointing me in that direction, a small tweak and the e2e tests should be passing now a14a112

@ZachJW34 ZachJW34 requested a review from tgriesser May 18, 2022 15:13
@MuazOthman MuazOthman requested a review from BlueWinds May 18, 2022 15:36
Copy link
Copy Markdown
Contributor

@BlueWinds BlueWinds left a comment

Choose a reason for hiding this comment

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

Some small suggestions, looks good overall. Thanks for the component refactors.


const testingTypeStatus = computed(() => {
return {
e2eStatus: props.gql.currentProject?.isE2EConfigured && props.gql.currentProject.currentTestingType === 'e2e'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These nested conditionals are pretty unpleasant to read. Can they be pulled out / pulled apart, rather than computed inline and then immediately destructured? Eg.

e2eStatus = computed(() => {
  if (!props.gql.currentProject?.isE2EConfigured) return 'notConfigured'
  return props.gql.currentProject.currentTestingType === 'e2e' ? 'running' : 'configured'
})
componentStatus = computed(() => {
  if (!props.gql.invokedFromCli) return 'disabled'
  if (!props.gql.currentProject?.isCTConfigured) return 'notConfigured'
  return props.gql.currentProject.currentTestingType === 'component' ? 'running' : 'configured'
})

or something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reads a lot better, gonna throw this in.

Comment on lines +526 to +527
"description": "Testing your components requires {0} as an NPM dependency for this project.",
"link": "installing Cypress"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd prefer active over passive voice here.

Suggested change
"description": "Testing your components requires {0} as an NPM dependency for this project.",
"link": "installing Cypress"
"description": "To test your components you must {0} as an NPM dependency for this project.",
"link": "install Cypress"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this verbiage, @ryanjwilke what do you think and can we get this updated in Figma

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BlueWinds going with your suggestion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Screen Shot 2022-05-23 at 7 08 52 PM

Figma should be updated to this now.

})

t.nonNull.boolean('invokedFromCli', {
description: 'Whether the app was invoked from the CLI',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: 'Whether the app was invoked from the CLI',
description: 'Whether the app was invoked from the CLI', False if user is using the binary without npm.

Just imagining coming in on this later and not being sure how else the app can be invoked.

@ZachJW34
Copy link
Copy Markdown
Contributor Author

@marktnoonan @tgriesser bump

@ZachJW34 ZachJW34 merged commit 0e32352 into 10.0-release May 20, 2022
@ZachJW34 ZachJW34 deleted the zachw/disable-ct-not-cli branch May 20, 2022 15:42
tgriesser added a commit that referenced this pull request May 25, 2022
…pack

* develop:
  test(launchpad): skip failure due to recaptcha on windows, enable more windows jobs (#21620)
  docs: add "Steps to test" to PR template (#21606)
  feat: (origin) handle waiting for aliased intercepts (#21579)
  fix: handle git watch error (#21600)
  fix: Successfully create new specs files that do not have a known extension (#21593)
  chore: release 9.7.0
  fix: do not allow experimentalSessionAndOrigin to be available in CT … (#21588)
  chore: sort the frameworks select dropdown in a more logical way (#21553)
  Trigger Build
  fix: disable ct testing when run via binary (#21540)
  chore: Update Chrome (beta) to 102.0.5005.61 (#21556)
  chore: release @cypress/react-v5.12.5
  fix: add support for Next.js v12.1.6 (#21516)
  chore: release @cypress/schematic-v1.7.0
  feat(cypress/schematic): add headed option and other fixes (#21415)
  chore: release @cypress/vite-dev-server-v2.2.3
  fix: handle specs with white space in vite-dev-server (#21386)
  Empty commit
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.

4 participants