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

fix: seed examples files when no e2e directory is created #19768

Merged
merged 22 commits into from
Jan 27, 2022

Conversation

elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Jan 19, 2022

Bug

  • yarn create vue new-project
  • yarn add cypress@10.X
  • cd ~/cypress-repo/
  • yarn dev
  • open new-project
  • run e2e
  • open chrome

On that screen click scaffold

Screen Shot 2022-01-18 at 2 49 04 PM

See the error

Screen Shot 2022-01-18 at 2 46 47 PM

Diagnosis

The cypress/e2e directory is read before it is created.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 19, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jan 19, 2022



Test summary

17933 0 216 0Flakiness 3


Run details

Project cypress
Status Passed
Commit 8c6051b
Started Jan 27, 2022 10:05 PM
Ended Jan 27, 2022 10:18 PM
Duration 12:42 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

net_stubbing.cy.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout incrementally waiting on requests
2 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
xhr.cy.js Flakiness
1 ... > no status when request isnt forced 404

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

@elevatebart elevatebart marked this pull request as ready for review January 20, 2022 15:35
@elevatebart elevatebart requested a review from ZachJW34 January 20, 2022 16:04
ZachJW34
ZachJW34 previously approved these changes Jan 20, 2022
Copy link
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

Tested, looks great. One small comment.

@@ -36,6 +36,9 @@ export async function codeGenerator (
const templateFiles = await allFilesInDir(action.templateDir)
const codeGenResults: CodeGenResults = { files: [], failed: [] }

// checks if the target directory exists and creates it if necessary
await fs.ensureDir(action.target)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unnecessary, since the generator uses fs.outputFile to generate files which will create the directory if it does not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it to replace this function maybeCreateE2EDir() that failed.
Asking stats on a non-existing directory does not work.

I hope it is not useful.

@@ -12,3 +14,18 @@ describe('App', () => {
cy.get('[href="#/settings"]').click()
})
})

describe('example files', () => {
Copy link
Contributor

@ZachJW34 ZachJW34 Jan 20, 2022

Choose a reason for hiding this comment

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

We already have a test for this that you can update if need be, we shouldn't duplicate the test.

tempSkip('scaffold example specs', () => {

Copy link
Contributor Author

@elevatebart elevatebart Jan 21, 2022

Choose a reason for hiding this comment

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

Agreed for improving the test.
We need to catch the "no file has been created" error
And we should catch the "Dialog opens in a blink and closes" error

@elevatebart elevatebart requested a review from ZachJW34 January 20, 2022 21:43
@elevatebart elevatebart marked this pull request as draft January 21, 2022 15:26
@elevatebart elevatebart marked this pull request as ready for review January 21, 2022 21:02
@elevatebart
Copy link
Contributor Author

@ZachJW34 included your remarks, you can review and feel free to merge.

ZachJW34
ZachJW34 previously approved these changes Jan 26, 2022
@elevatebart elevatebart merged commit cec46df into 10.0-release Jan 27, 2022
@elevatebart elevatebart deleted the elevatebart/fix/examples-file-empty branch January 27, 2022 22:51
tgriesser added a commit that referenced this pull request Jan 31, 2022
* 10.0-release: (25 commits)
  fix(unify): improve dev server config ergonomics (#19957)
  feat: add spec pattern modal (#19801)
  fix: Windows e2e project scaffolding issues (#19938)
  feat: update @cypress/schematic to use proper e2e config for 10.0.0 (#19827)
  fix: correctly migrate projects with custom integration folder (#19929)
  fix: component spec creation with spec pattern (#19862)
  fix: missed committing yarn.lock after merge conflict
  fix: correct reference branch / commitSha in performance-reporter (#19941)
  feat: update navbar UI per Figma (#19926)
  fix: seed examples files when no e2e directory is created (#19768)
  chore: remove windy lightBlue warning
  test: component test updates (#19925)
  feat: Focus browser from select browser screen and on dashboard login (#19842)
  test: Honeycomb system-test reporter (#19855)
  fix(deps): update dependency engine.io to v5.2.1 [security]
  feat: Retain fileName when working with aliased fixtures and files (#19820)
  Update release-process.md
  Update release-process.md
  Update release-process.md
  Update release-process.md
  ...
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