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

chore: Add e2e tests for global mode #18719

Merged
merged 7 commits into from
Nov 4, 2021

Conversation

chrisbreiding
Copy link
Contributor

PR Tasks

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 1, 2021

Thanks for taking the time to open a PR!

@chrisbreiding chrisbreiding changed the title Add e2e test for global mode chore: Add e2e test for global mode Nov 1, 2021
@cypress
Copy link

cypress bot commented Nov 1, 2021



Test summary

1038 0 8 0Flakiness 0


Run details

Project cypress
Status Passed
Commit 28000a5
Started Nov 3, 2021 6:12 PM
Ended Nov 3, 2021 6:22 PM
Duration 09:51 💡
OS Linux Debian - 10.9
Browser Electron 93

View run in Cypress Dashboard ➡️


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
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.

If we get --global and have a project (eg, launched from within a project workspace, or with --project given explicitly) at the same time, which should take precedence? I'm assuming --global.

Might be worth at least having to verify that you can access global mode from within a project workspace (which I think is the purpose of the flag).

@tgriesser
Copy link
Member

Speaking of flags... planning on doing some work in a separate PR to get our CLI flags working a bit better with the new workflow, it's a bit inconsistent right now, both in the code and in testing setup.

Was thinking that we could be able to specify them in the standard CLI format, which would run them through the validator:

// equivalent to cypress open --project=path/to/project-name, or cypress open in that directory
cy.setupE2E('project-name')
cy.setupE2E('project-name', '--component') // yarn cypress open --project=path/to/project-name --component
cy.setupE2E('project-name', '--global') // yarn cypress open --project=path/to/project-name --global

@BlueWinds @chrisbreiding thoughts?

@BlueWinds
Copy link
Contributor

Speaking of flags... planning on doing some work in a separate PR to get our CLI flags working a bit better with the new workflow, it's a bit inconsistent right now, both in the code and in testing setup.

Was thinking that we could be able to specify them in the standard CLI format, which would run them through the validator:

// equivalent to cypress open --project=path/to/project-name, or cypress open in that directory
cy.setupE2E('project-name')
cy.setupE2E('project-name', '--component') // yarn cypress open --project=path/to/project-name --component
cy.setupE2E('project-name', '--global') // yarn cypress open --project=path/to/project-name --global

@BlueWinds @chrisbreiding thoughts?

That sounds really nice. We could run the args directly through the CLI parser (cli/lib/cli.js), which would make it more truly e2e by including a bunch of our cli code directly in every test.

@chrisbreiding
Copy link
Contributor Author

If we get --global and have a project (eg, launched from within a project workspace, or with --project given explicitly) at the same time, which should take precedence? I'm assuming --global.

I think we should probably error if you pass both flags, since they're mutually incompatible.

Might be worth at least having to verify that you can access global mode from within a project workspace (which I think is the purpose of the flag).

True. I'm not sure there's a way to write a test for that though.

@chrisbreiding chrisbreiding requested a review from a team as a code owner November 3, 2021 17:24
@chrisbreiding chrisbreiding requested review from jennifer-shehane and removed request for a team November 3, 2021 17:24
@jennifer-shehane jennifer-shehane removed their request for review November 3, 2021 17:30
// load the cached user & validate the token on start
this.actions.auth.getUser(),
]

if (this._config._internalOptions.loadCachedProjects) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Loading cached projects leads to test pollution for any tests concerning the projects list since the cache is empty in CI and different between different developers' machines. This allows the e2e test infrastructure to skip loading cached projects while defaulting to loading them in production. @tgriesser I'm open to other ideas on how to implement this.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's fine - going to be cleaning up a lot of DataContext things in #18776 and will add this to the list of things to look at

@chrisbreiding chrisbreiding changed the title chore: Add e2e test for global mode chore: Add e2e tests for global mode Nov 4, 2021
@chrisbreiding chrisbreiding merged commit 0422ede into unified-desktop-gui Nov 4, 2021
@chrisbreiding chrisbreiding deleted the issue-18651-global-mode-e2e-test branch November 4, 2021 13:31
tgriesser added a commit that referenced this pull request Nov 4, 2021
…ve-activeProject

* unified-desktop-gui: (57 commits)
  chore: Add e2e tests for global mode (#18719)
  chore: add percy to app and launchpad package (#18781)
  chore: update test
  refactor: move settings in app (#18729)
  feat: setup launchpad lifecycle (#18734)
  feat(app): decouple event manager from driver (#18695)
  chore: Force single resolution for core modules, infinite loop guard (#18764)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: cleaning up the runner container pattern (#18741)
  feat: Use .config files (#18578)
  chore(app): basic style and example to stop scrollIntoView bug (#18736)
  chore: make `create` function on server.ts obsolete (#18615)
  feat: add codegen utility (#18708)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  fix: support using create-cypress-tests as part of build process (#18714)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  fix(app): do not cache graphql (#18716)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  ...
tgriesser added a commit that referenced this pull request Nov 5, 2021
* unified-desktop-gui:
  fix(unify): Hide duration from Percy snapshots (#18788)
  chore: Add e2e tests for global mode (#18719)
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