From e9c0d440550d47892cae69d0399b3e0da7daa21a Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Thu, 20 Feb 2020 20:55:42 +0100 Subject: [PATCH 1/3] Favor firefox as test runner in cypress - we have recommended our users to use firefox, so why should we test in Electron? --- .travis.yml | 3 ++- cypress/integration/common/report.js | 2 +- package.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cfb983cd..f6fdffebf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,8 @@ addons: - libgconf-2-4 snaps: - docker - + firefox: "latest-esr" + install: - yarn global add wait-on # Install Codecov diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index e85bd9662..4c6d2f6c3 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -169,7 +169,7 @@ Then('each list item links to the post page', () => { Then('I can visit the post page', () => { cy.contains(annoyingUserWhoMutedModeratorTitle).click() cy.location('pathname').should('contain', '/post') - .get('title').should('contain', annoyingUserWhoMutedModeratorTitle) + .get('.base-card .title').should('contain', annoyingUserWhoMutedModeratorTitle) }) When("they have a post someone has reported", () => { diff --git a/package.json b/package.json index 6a08ce857..afa03eaa8 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "cypress:backend": "cd backend && yarn run dev", "cypress:webapp": "cd webapp && yarn run dev", "cypress:setup": "run-p cypress:backend cypress:webapp", - "cypress:run": "cross-env cypress run", - "cypress:open": "cross-env cypress open", + "cypress:run": "cross-env cypress run --browser firefox", + "cypress:open": "cross-env cypress open --browser firefox", "cucumber:setup": "cd backend && yarn run dev", "cucumber": "wait-on tcp:4000 && cucumber-js --require-module @babel/register --exit", "release": "standard-version", From 2516da57c2a3aae3b43dce28d1a89eacfbae4790 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 21 Feb 2020 14:50:17 +0100 Subject: [PATCH 2/3] Add cypress retries again --- cypress.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index f41489007..284bdbd34 100644 --- a/cypress.json +++ b/cypress.json @@ -1,5 +1,8 @@ { "projectId": "qa7fe2", "ignoreTestFiles": "*.js", - "baseUrl": "http://localhost:3000" + "baseUrl": "http://localhost:3000", + "env": { + "RETRIES": 2 + } } From a09a767fd19ff49d0701ac797fd31cedb02be35f Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 21 Feb 2020 18:58:16 +0100 Subject: [PATCH 3/3] Visit root path before reloading --- cypress/integration/common/steps.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index f3e1b7988..c02829b25 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -167,7 +167,8 @@ When("I fill in my email and password combination and click submit", () => { }); When(/(?:when )?I refresh the page/, () => { - cy.reload(); + cy.visit('/') + .reload(); }); When("I log out through the menu in the top right corner", () => {