From c593785565759ebe2531619ad7fafbd448bc29e5 Mon Sep 17 00:00:00 2001 From: Murat Ozcan Date: Wed, 4 May 2022 09:44:39 -0500 Subject: [PATCH] added Cypress Dashboard --- .github/workflows/main.yml | 6 +++++- cypress.json | 3 ++- site/comments.md | 14 +++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ecabad9a7..03e18633e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,13 @@ jobs: browser: chrome start: yarn dev wait-on: 'http://localhost:3000' - wait-on-timeout: 120 + wait-on-timeout: 120000 + record: true env: COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN }} NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED: true + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # pass GitHub token to allow accurately detecting a build vs a re-run build + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cypress.json b/cypress.json index 057250301..d7a538445 100644 --- a/cypress.json +++ b/cypress.json @@ -1,5 +1,6 @@ { "baseUrl": "http://localhost:3000", "viewportHeight": 1000, - "viewportWidth": 1280 + "viewportWidth": 1280, + "projectId": "pefcjb" } diff --git a/site/comments.md b/site/comments.md index a7e0ef094..4660a0c5d 100644 --- a/site/comments.md +++ b/site/comments.md @@ -348,10 +348,6 @@ Yes, we are performing these in the guide, but the rule of 3 is key knowledge, c _____ -We could bring up an optional Cypress Dashboard topic here. Not only that would be good for knowledge, but also promote Cypress some. But maybe it could be better to cause an intentional CI failure, then bring it up when there is a need. Something to consider. The distinction that needs to be made is `CYPRESS_RECORD_KEY` is not really needed in the local `.env` file, but it is still needed in Github secrets and the yml file. - -____________ - When did we create a `header.spec.js` file? It is possible that one might miss this. Perhaps at the end of Part 3 we give a tree structure and the final, ready-to-copy code for the spec files. ```bash @@ -395,7 +391,7 @@ jobs: browser: chrome start: yarn dev wait-on: 'http://localhost:3000' - wait-on-timeout: 120 + wait-on-timeout: 120000 env: COMMERCE_PROVIDER: ${{ secrets.COMMERCE_PROVIDER }} NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN: ${{ secrets.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN }} @@ -422,7 +418,15 @@ it("the search bar returns the correct search results", () => { ``` +_________ +## [Part 5 Running Our Tests in Parallel with Cypress Dashboard](https://learn.cypress.io/tutorials/running-our-tests-in-parallel-with-cypress-dashboard) +As of today May 4th, 2022, Cypress Dashboard looks different and those screen shots should be updated. +____ + +Question about `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`. Cypress Dashboard requires unique runIds. For example if we re-run a CI action, what happens is the job passes without actually running any tests. How does this setting effect that? + +_________