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

#2911 cypress e2e #3451

Merged
merged 72 commits into from
Aug 5, 2022
Merged

#2911 cypress e2e #3451

merged 72 commits into from
Aug 5, 2022

Conversation

petersopko
Copy link
Contributor

@petersopko petersopko commented Jul 16, 2022

Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.

PR type

  • Bugfix
  • Feature
  • Refactoring

What's new?

What was added:

  • first E2E test suite which can be run locally by devs against their locally built app at http://localhost:9090/
  • the way to run the tests is to go to nft-gallery/tests and running cypress run which prompts tests to run in headless mode
  • new route with /e2e-login was added, which is logging in user with random wallet provided (we want to simulate logged in user experience but we don't have available extension since this is automated test)
  • tests are checking correct app behavior at landing, explore, gallery, collections, item details and collection details
  • tests execution can be explored at tests/cypress/e2e/basicE2E.cy.ts
  • custom commands (functions) can be checked out at tests/cypress/support/commands.ts
  • cypress config resides at tests/cypress.config.ts
  • offtopic: added pnpm dev-win to get around weird error I'm facing at my win machine: 'PORT' is not recognized as an internal or external command, operable program or batch file.

Before submitting Pull Request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality
  • I've posted a screenshot of demonstrated change in this PR

Optional

  • I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
  • I've tested PR on mobile and everything seems works
  • I found edge cases
  • I've written some unit tests 🧪

Had issue bounty label?

  • Fill up your KSM address: Payout

Community participation

Screenshot

  • My fix has changed something on UI; a screenshot is best to understand changes for others.
basicE2E.cy.ts.mp4

@netlify
Copy link

netlify bot commented Jul 16, 2022

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit 2d5168c
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/62ed014c5a1bee00080b80d2
😎 Deploy Preview https://deploy-preview-3451--koda-nuxt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@kkukelka kkukelka left a comment

Choose a reason for hiding this comment

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

code lgtm now

@kkukelka kkukelka added the S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved label Aug 4, 2022
@petersopko
Copy link
Contributor Author

@vikiival can you please try to run this locally? I'll create an issue concerning the tests in general and the future of this, I'd just like to have this checked by somebody else

@vikiival
Copy link
Member

vikiival commented Aug 5, 2022

  3 failing

  1) exploreBsxGallery
       expandGallerySearch:
     CypressError: Timed out retrying after 4050ms: `cy.click()` failed because this element:

`<a id="GALLERY-label" tabindex="0">...</a>`

is being covered by another element:

`<div class="loading-background"></div>`

Fix this problem, or use {force: true} to disable error checking.

https://on.cypress.io/element-cannot-be-interacted-with
      at $Cy.ensureDescendents (http://localhost:9090/__cypress/runner/cypress_runner.js:162005:78)
      at ensureDescendents (http://localhost:9090/__cypress/runner/cypress_runner.js:147397:8)
      at ensureDescendentsAndScroll (http://localhost:9090/__cypress/runner/cypress_runner.js:147404:14)
      at ensureElIsNotCovered (http://localhost:9090/__cypress/runner/cypress_runner.js:147536:5)
      at runAllChecks (http://localhost:9090/__cypress/runner/cypress_runner.js:147726:52)
      at retryActionability (http://localhost:9090/__cypress/runner/cypress_runner.js:147750:16)
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Function.Promise.attempt.Promise.try (http://localhost:9090/__cypress/runner/cypress_runner.js:10286:29)
      at whenStable (http://localhost:9090/__cypress/runner/cypress_runner.js:166931:65)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:166385:14
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Promise._settlePromiseFromHandler (http://localhost:9090/__cypress/runner/cypress_runner.js:10947:31)
      at Promise._settlePromise (http://localhost:9090/__cypress/runner/cypress_runner.js:11004:18)
      at Promise._settlePromise0 (http://localhost:9090/__cypress/runner/cypress_runner.js:11049:10)
      at Promise._settlePromises (http://localhost:9090/__cypress/runner/cypress_runner.js:11129:18)
      at Promise._fulfill (http://localhost:9090/__cypress/runner/cypress_runner.js:11073:18)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:12687:46
  From Your Spec Code:
      at Context.eval (http://localhost:9090/__cypress/tests?p=cypress/e2e/basicE2E.cy.ts:174:36)

  2) exploreBsxGallery
       galleryInputFields:
     CypressError: Timed out retrying after 4000ms: `cy.type()` failed because this element is not visible:

`<input type="number" autocomplete="on" min="0" step="any" placeholder="MIN PRICE" data-cy="input-min" class="input">`

This element `<input.input>` is not visible because its parent `<div#sortAndFilter.collapse-content>` has CSS property: `display: none`

Fix this problem, or use `{force: true}` to disable error checking.

https://on.cypress.io/element-cannot-be-interacted-with
      at runVisibilityCheck (http://localhost:9090/__cypress/runner/cypress_runner.js:161836:76)
      at $Cy.ensureStrictVisibility (http://localhost:9090/__cypress/runner/cypress_runner.js:161852:12)
      at runAllChecks (http://localhost:9090/__cypress/runner/cypress_runner.js:147695:14)
      at retryActionability (http://localhost:9090/__cypress/runner/cypress_runner.js:147750:16)
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Function.Promise.attempt.Promise.try (http://localhost:9090/__cypress/runner/cypress_runner.js:10286:29)
      at whenStable (http://localhost:9090/__cypress/runner/cypress_runner.js:166931:65)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:166385:14
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Promise._settlePromiseFromHandler (http://localhost:9090/__cypress/runner/cypress_runner.js:10947:31)
      at Promise._settlePromise (http://localhost:9090/__cypress/runner/cypress_runner.js:11004:18)
      at Promise._settlePromise0 (http://localhost:9090/__cypress/runner/cypress_runner.js:11049:10)
      at Promise._settlePromises (http://localhost:9090/__cypress/runner/cypress_runner.js:11129:18)
      at Promise._fulfill (http://localhost:9090/__cypress/runner/cypress_runner.js:11073:18)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:12687:46
  From Your Spec Code:
      at Context.eval (http://localhost:9090/__cypress/tests?p=cypress/support/e2e.ts:235:37)

  3) exploreBsxGallery
       gallerySortBsx:
     CypressError: Timed out retrying after 4050ms: `cy.click()` failed because this element is not visible:

`<button type="button" data-cy="gallery-sort-by" class="button is-primary">...</button>`

This element `<button.button.is-primary>` is not visible because its parent `<div#sortAndFilter.collapse-content>` has CSS property: `display: none`

Fix this problem, or use `{force: true}` to disable error checking.

https://on.cypress.io/element-cannot-be-interacted-with
      at runVisibilityCheck (http://localhost:9090/__cypress/runner/cypress_runner.js:161836:76)
      at $Cy.ensureStrictVisibility (http://localhost:9090/__cypress/runner/cypress_runner.js:161852:12)
      at runAllChecks (http://localhost:9090/__cypress/runner/cypress_runner.js:147695:14)
      at retryActionability (http://localhost:9090/__cypress/runner/cypress_runner.js:147750:16)
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Function.Promise.attempt.Promise.try (http://localhost:9090/__cypress/runner/cypress_runner.js:10286:29)
      at whenStable (http://localhost:9090/__cypress/runner/cypress_runner.js:166931:65)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:166385:14
      at tryCatcher (http://localhost:9090/__cypress/runner/cypress_runner.js:13012:23)
      at Promise._settlePromiseFromHandler (http://localhost:9090/__cypress/runner/cypress_runner.js:10947:31)
      at Promise._settlePromise (http://localhost:9090/__cypress/runner/cypress_runner.js:11004:18)
      at Promise._settlePromise0 (http://localhost:9090/__cypress/runner/cypress_runner.js:11049:10)
      at Promise._settlePromises (http://localhost:9090/__cypress/runner/cypress_runner.js:11129:18)
      at Promise._fulfill (http://localhost:9090/__cypress/runner/cypress_runner.js:11073:18)
      at http://localhost:9090/__cypress/runner/cypress_runner.js:12687:46
  From Your Spec Code:
      at Context.eval (http://localhost:9090/__cypress/tests?p=cypress/support/e2e.ts:146:147)




  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        30                                                                               │
  │ Passing:      27                                                                               │
  │ Failing:      3                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     1 minute, 1 second                                                               │
  │ Spec Ran:     basicE2E.cy.ts                                                                   │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


==============================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✖  basicE2E.cy.ts                           01:01       30       27        3        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✖  1 of 1 failed (100%)                     01:01       30       27        3        -        -

 ELIFECYCLE  Command failed with exit code 3.
 ```

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

Smol stuff ? I guess?

@vikiival
Copy link
Member

vikiival commented Aug 5, 2022

Also as promised:

@petersopko petersopko dismissed vikiival’s stale review August 5, 2022 11:50

made some changes, ran this couple times and everything's passing

@vikiival vikiival self-requested a review August 5, 2022 12:00
@petersopko petersopko merged commit 94e8e3e into kodadot:main Aug 5, 2022
This was referenced Aug 5, 2022
@petersopko petersopko deleted the 2911-cypress-init branch September 13, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants