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

test: fix 2 broken tests for Windows #26854

Merged
merged 3 commits into from
May 25, 2023
Merged

Conversation

warrensplayer
Copy link
Contributor

@warrensplayer warrensplayer commented May 24, 2023

Additional details

Test 1

it('lists files after folders when in same directory', () => {

Failing test in windows introduced with PR: #26723

See example of failed test here: https://app.circleci.com/pipelines/github/cypress-io/cypress/52876/workflows/f790b06f-4a4c-4efc-b901-6151139f5947/jobs/2180318/tests#failed-test-1

Solution is to convert the value used for the selector for windows since the id for the element is created from a file system path

Test 2

describe('runSpec mutation', () => {

Solution is to call toPosix on the absolute spec path to align the Windows path with what is actually stored in the data context. For this test, the absolute windows path is

C:\Users\ADMINI~1\AppData\Local\Temp\2\cy-projects\cypress-in-cypress\cypress\e2e\dom-content.spec.js

but what is stored in the data context under project.specs is:

C:/Users/ADMINI~1/AppData/Local/Temp/2/cy-projects/cypress-in-cypress/cypress/e2e/dom-content.spec.js

Notice the forward versus backwards slashes

Steps to test

Confirm test is passing in linux and windows on CI

How has the user experience changed?

PR Tasks

@warrensplayer warrensplayer marked this pull request as ready for review May 24, 2023 14:43
@cypress
Copy link

cypress bot commented May 24, 2023

8 flaky tests on run #46760 ↗︎

0 459 13 0 Flakiness 8

Details:

Align absolute path for windows
Project: cypress Commit: 34872095ba
Status: Passed Duration: 19:00 💡
Started: May 24, 2023 6:11 PM Ended: May 24, 2023 6:30 PM
Flakiness  cypress\e2e\create-from-component.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
... > Shows create from component card for React projects Output Screenshots Video
Flakiness  cypress\e2e\specs.cy.ts • 2 flaky tests • app-e2e

View Output Video

Test Artifacts
... > shows No Specs page with specPattern from config Output Screenshots Video
... > create template spec > shows success modal when template spec is created Output Screenshots Video
Flakiness  cypress\e2e\specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Output Screenshots Video
Flakiness  cypress\e2e\cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution Output Screenshots Video
Flakiness  cypress\e2e\debug.cy.ts • 2 flaky tests • app-e2e

View Output Video

Test Artifacts
App - Debug Page > all tests passed Output Screenshots Video
App - Debug Page > shows information about a failed spec Output Screenshots Video

The first 5 flaky specs are shown, see all 6 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@warrensplayer warrensplayer changed the title test: correct selector id to work with windows path test: fix 2 broken tests for Windows May 24, 2023
@warrensplayer warrensplayer requested review from a team May 24, 2023 20:33
Copy link
Contributor

@astone123 astone123 left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -606,9 +606,12 @@ export class ProjectActions {
// Now that we're in the correct testingType, verify the requested spec actually exists
// We don't have specs available until a testingType is loaded, so even through we validated
// a matching file exists above it may not end up loading as a valid spec so we validate that here
const spec = this.ctx.project.getCurrentSpecByAbsolute(absoluteSpecPath)
//
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: remove this empty comment?

@warrensplayer warrensplayer merged commit 850973e into develop May 25, 2023
@warrensplayer warrensplayer deleted the stokes/fix_windows_e2e_test branch May 25, 2023 17:27
mjhenkes added a commit that referenced this pull request Jun 2, 2023
* chore: add Nx Cloud (#26712)

* chore: add empty nx.json [run ci]

* chore: add nx cloud runner [run ci]

* chore: add nx-cloud dep [run ci]

* chore: update local nx cloud accessToken to be read-only

* feat: update git related messages for runs and debug (#26758)

* feat(app): update DebugError copy

* feat: set isUsingGit project flag and consume in DebugContainer

* feat(app): update not using git icon for DebugError

* feat(app): displays alert on runs page when not using git

* feat(app): add component for when no runs for current branch

* feat(app): add warning for no runs for branch on runs container

* chore: add feat to CHANGELOG

* chore: remove logged status value

* chore: resolve import from merge conflict

* test(app): stub branch name for e2e runs spec

* chore: add line break in changelog entry

* chore: cleanup PR

* chore: fix i18n import for DebugBranchError

* chore: add utm and update Warning links to inline

* chore: capitalize Git in i18n

* ref: warning liink

* test: add i18n to tests

* test(app): change utm_source assertions

* chore: cleanup pr

* chore: remove unused prop

* test(app): remove no git warning when moving to runs page in e2e

* chore: change template logic

* chore: remove duplicate RUNS_TAB_MEDIUM const

* Changed Debug test assertion and reordered new components for Debug

---------

Co-authored-by: Stokes Player <[email protected]>

* chore: rename video processing events to capture/compress (#26800)

* chore: change processing nomenclature to compressing when printing the run.

* chore: rename 'capturing of' to 'capturing'

* chore: rename upload results to upload screenshots & videos (#26811)

* chore: rename upload results to upload screenshots & videos

* run ci

* chore: capture versions of relevant dependencies with `x-dependencies` header (#26814)

* chore: update changlelog script to handle revert pr ref (#26801)

* fix: Correct typescript scaffold dependency (#26815)

* fix: correct typescript scaffold dependency (#26204)

* add changelog

* Update change log for PR comment

Co-authored-by: Mike Plummer <[email protected]>

---------

Co-authored-by: Mike Plummer <[email protected]>
Co-authored-by: Mark Noonan <[email protected]>

* chore: 12.13.0 prep (#26833)

* chore: 12.13.0 release (#26834)

* chore: 12.13.0 changelog fix

* remove pending, bump version

* fix typo

* chore: release @cypress/vite-plugin-cypress-esm-v1.0.1

[skip ci]

* chore: Implement runSpec mutation (#26782)

* chore: replace gitter badge with discord on readme (#26771)

* chore: add GraphQL mutation for sending system notifications via Electron (#26773)

* fix: upgrade typescript from 4.7.4 to 4.9.5 (#26826)

Snyk has created this PR to upgrade typescript from 4.7.4 to 4.9.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/cypress-opensource/project/d5b36925-e6ee-455d-9649-6560a9aca413?utm_source=github&utm_medium=referral&page=upgrade-pr

* test: fix 2 broken tests for Windows (#26854)

* Update stale_issues_and_pr_cleanup.yml

Upped the number of operations per run.  Have been manually doing that so this job can get through all the issues in the repo with no problems.

* chore(dep): [Snyk] Upgrade vite from 2.9.13 to 2.9.15 (#26830)

Co-authored-by: Ben M <[email protected]>

* Update triage_add_to_project.yml

* chore: fix minor background color styling in debug results component (#26887)

* Update stale_issues_and_pr_cleanup.yml

stalebot was incorrectly configured to run in debug mode.  I have updated the default to run in normal mode when running scheduled

* chore: Deprecate @cypress/xpath package (#26893)

* chore: add telemetry realworld app (#26896)

* chore: capture telemetry for realworld app maybe

* idk what i was doing

* setup record key and telemetry

* testing

* override project id

* some times we just need a little context.

* Adding tests

* Adding comment

* fix yarn lock

* Trying this....

* fix tests?

---------

Co-authored-by: Jordan <[email protected]>
Co-authored-by: Stokes Player <[email protected]>
Co-authored-by: Bill Glesias <[email protected]>
Co-authored-by: Adam Stone-Lord <[email protected]>
Co-authored-by: Emily Rohrbough <[email protected]>
Co-authored-by: Dave Kasper <[email protected]>
Co-authored-by: Mike Plummer <[email protected]>
Co-authored-by: Mark Noonan <[email protected]>
Co-authored-by: Chris Breiding <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: Ely Lucas <[email protected]>
Co-authored-by: Snyk bot <[email protected]>
Co-authored-by: Stokes Player <[email protected]>
Co-authored-by: Ben M <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
mjhenkes added a commit that referenced this pull request Jun 2, 2023
* chore: add Nx Cloud (#26712)

* chore: add empty nx.json [run ci]

* chore: add nx cloud runner [run ci]

* chore: add nx-cloud dep [run ci]

* chore: update local nx cloud accessToken to be read-only

* feat: update git related messages for runs and debug (#26758)

* feat(app): update DebugError copy

* feat: set isUsingGit project flag and consume in DebugContainer

* feat(app): update not using git icon for DebugError

* feat(app): displays alert on runs page when not using git

* feat(app): add component for when no runs for current branch

* feat(app): add warning for no runs for branch on runs container

* chore: add feat to CHANGELOG

* chore: remove logged status value

* chore: resolve import from merge conflict

* test(app): stub branch name for e2e runs spec

* chore: add line break in changelog entry

* chore: cleanup PR

* chore: fix i18n import for DebugBranchError

* chore: add utm and update Warning links to inline

* chore: capitalize Git in i18n

* ref: warning liink

* test: add i18n to tests

* test(app): change utm_source assertions

* chore: cleanup pr

* chore: remove unused prop

* test(app): remove no git warning when moving to runs page in e2e

* chore: change template logic

* chore: remove duplicate RUNS_TAB_MEDIUM const

* Changed Debug test assertion and reordered new components for Debug

---------

Co-authored-by: Stokes Player <[email protected]>

* chore: rename video processing events to capture/compress (#26800)

* chore: change processing nomenclature to compressing when printing the run.

* chore: rename 'capturing of' to 'capturing'

* chore: rename upload results to upload screenshots & videos (#26811)

* chore: rename upload results to upload screenshots & videos

* run ci

* chore: capture versions of relevant dependencies with `x-dependencies` header (#26814)

* chore: update changlelog script to handle revert pr ref (#26801)

* fix: Correct typescript scaffold dependency (#26815)

* fix: correct typescript scaffold dependency (#26204)

* add changelog

* Update change log for PR comment

Co-authored-by: Mike Plummer <[email protected]>

---------

Co-authored-by: Mike Plummer <[email protected]>
Co-authored-by: Mark Noonan <[email protected]>

* chore: 12.13.0 prep (#26833)

* chore: 12.13.0 release (#26834)

* chore: 12.13.0 changelog fix

* remove pending, bump version

* fix typo

* chore: release @cypress/vite-plugin-cypress-esm-v1.0.1

[skip ci]

* chore: Implement runSpec mutation (#26782)

* chore: replace gitter badge with discord on readme (#26771)

* chore: add GraphQL mutation for sending system notifications via Electron (#26773)

* fix: upgrade typescript from 4.7.4 to 4.9.5 (#26826)

Snyk has created this PR to upgrade typescript from 4.7.4 to 4.9.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/cypress-opensource/project/d5b36925-e6ee-455d-9649-6560a9aca413?utm_source=github&utm_medium=referral&page=upgrade-pr

* test: fix 2 broken tests for Windows (#26854)

* Update stale_issues_and_pr_cleanup.yml

Upped the number of operations per run.  Have been manually doing that so this job can get through all the issues in the repo with no problems.

* chore(dep): [Snyk] Upgrade vite from 2.9.13 to 2.9.15 (#26830)

Co-authored-by: Ben M <[email protected]>

* Update triage_add_to_project.yml

* chore: fix minor background color styling in debug results component (#26887)

* Update stale_issues_and_pr_cleanup.yml

stalebot was incorrectly configured to run in debug mode.  I have updated the default to run in normal mode when running scheduled

* chore: Deprecate @cypress/xpath package (#26893)

* chore: add telemetry realworld app (#26896)

* chore: capture telemetry for realworld app maybe

* idk what i was doing

* setup record key and telemetry

* testing

* override project id

* some times we just need a little context.

* Adding tests

* Adding comment

* chore(deps): update dependency find-process to v1.4.7 🌟 (#26906)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <[email protected]>

* chore(deps): update dependency firefox-profile to v4.3.2 🌟 (#26912)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <[email protected]>

---------

Co-authored-by: Jordan <[email protected]>
Co-authored-by: Stokes Player <[email protected]>
Co-authored-by: Bill Glesias <[email protected]>
Co-authored-by: Adam Stone-Lord <[email protected]>
Co-authored-by: Emily Rohrbough <[email protected]>
Co-authored-by: Dave Kasper <[email protected]>
Co-authored-by: Mike Plummer <[email protected]>
Co-authored-by: Mark Noonan <[email protected]>
Co-authored-by: Chris Breiding <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: Ely Lucas <[email protected]>
Co-authored-by: Snyk bot <[email protected]>
Co-authored-by: Stokes Player <[email protected]>
Co-authored-by: Ben M <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 7, 2023

Released in 12.14.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.14.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants