From b074f0ceaab6b2fa2efe8f7e136dfb74f327116f Mon Sep 17 00:00:00 2001 From: Kevin Old Date: Tue, 16 Jun 2020 15:21:57 -0500 Subject: [PATCH] Update Docker Image, .node-version to use Node 12.18.0, fix additional flake (#428) * update docker image * update node version to 12.18 * wait for comment to be posted * set firefoxGcInterval to null per https://github.com/cypress-io/cypress/issues/6813 * remove quotes from cypress config * add assertion to fix additional flake * set firefoxGcInterval to null in cypress.json vs circle config * ensure like button click is registered on server --- .circleci/config.yml | 4 ++-- .node-version | 2 +- cypress.json | 1 + cypress/tests/ui/notifications.spec.ts | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07590c318..f034386f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ orbs: executors: with-chrome-and-firefox: docker: - - image: "cypress/browsers:node12.16.2-chrome81-ff75" + - image: "cypress/browsers:node12.18.0-chrome83-ff77" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # commands: @@ -118,7 +118,7 @@ linux-workflow: &linux-workflow name: "UI Tests - Firefox - Mobile" browser: firefox spec: cypress/tests/ui/* - config: "viewportWidth=375,viewportHeight=667" + config: viewportWidth=375,viewportHeight=667 executor: with-chrome-and-firefox wait-on: "http://localhost:3000" yarn: true diff --git a/.node-version b/.node-version index 499fd8b18..a66526b79 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -12.16 \ No newline at end of file +12.18 \ No newline at end of file diff --git a/cypress.json b/cypress.json index 1ea36acce..441625f6a 100644 --- a/cypress.json +++ b/cypress.json @@ -4,6 +4,7 @@ "integrationFolder": "cypress/tests", "viewportHeight": 1000, "viewportWidth": 1280, + "firefoxGcInterval": null, "env": { "apiUrl": "http://localhost:3001", "mobileViewportWidthBreakpoint": 414, diff --git a/cypress/tests/ui/notifications.spec.ts b/cypress/tests/ui/notifications.spec.ts index 9e8488c55..f76ee7c21 100644 --- a/cypress/tests/ui/notifications.spec.ts +++ b/cypress/tests/ui/notifications.spec.ts @@ -86,7 +86,11 @@ describe("Notifications", function () { cy.visit(`/transaction/${transaction.id}`); }); + const likesCountSelector = "[data-test*=transaction-like-count]"; + cy.contains(likesCountSelector, 0); cy.getBySelLike("like-button").click(); + cy.getBySelLike("like-button").should("be.disabled"); + cy.contains(likesCountSelector, 1); cy.switchUser(ctx.userA.username); @@ -97,6 +101,7 @@ describe("Notifications", function () { cy.location("pathname").should("equal", "/notifications"); cy.getBySelLike("notification-list-item") + .should("have.length", 9) .first() .should("contain", ctx.userC.firstName) .and("contain", "liked"); @@ -125,6 +130,8 @@ describe("Notifications", function () { cy.getBySelLike("comment-input").type("Thank You{enter}"); + cy.wait("@postComment"); + cy.switchUser(ctx.userB.username); cy.getBySelLike("notifications-link").click();