-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
199246a
commit ec05922
Showing
13 changed files
with
2,062 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
export const CypressE2eCommonConfig = { | ||
excludeSpecPattern: "*.ts", | ||
testIsolation: true, | ||
async setupNodeEvents( | ||
on: Cypress.PluginEvents, | ||
config: Cypress.PluginConfigOptions | ||
): Promise<Cypress.PluginConfigOptions> { | ||
await addCucumberPreprocessorPlugin(on, config); | ||
return config; | ||
}, | ||
}; | ||
|
||
export const CypressCommonConfig = { | ||
video: true, | ||
screenshotOnRunFailure: true, | ||
defaultCommandTimeout: 30000, | ||
pageLoadTimeout: 150000, | ||
requestTimeout: 150000, | ||
watchForFileChanges: false, | ||
numTestsKeptInMemory: 50, | ||
viewportHeight: 900, | ||
viewportWidth: 1440, | ||
chromeWebSecurity: false, | ||
retries: { | ||
runMode: 2, | ||
openMode: 0, | ||
}, | ||
e2e: CypressE2eCommonConfig, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineConfig } from "cypress"; | ||
import { CypressCommonConfig, CypressE2eCommonConfig } from "./common.config"; | ||
|
||
export default defineConfig({ | ||
...CypressCommonConfig, | ||
projectId: "6ipboc", | ||
e2e: { | ||
...CypressE2eCommonConfig, | ||
specPattern: "cypress/e2e/journeys/**/*.dev.feature", | ||
baseUrl: "http://localhost:3000", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineConfig } from "cypress"; | ||
import { CypressCommonConfig, CypressE2eCommonConfig } from "./common.config"; | ||
|
||
export default defineConfig({ | ||
...CypressCommonConfig, | ||
projectId: "6ipboc", | ||
e2e: { | ||
...CypressE2eCommonConfig, | ||
specPattern: "cypress/e2e/journeys/**/*.prod.feature", | ||
baseUrl: "https://meetthecountries.com", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: Platform Navigation | ||
@smoke | ||
Scenario Outline: Login, navigation ( Track / Plan / Report ) and logout | ||
When I perform a full login with user "<userIdentifier>" | ||
# Header navigation | ||
Then I should see the text "Meet the countries" on header |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const pageDescriptor = { | ||
url: "/track", | ||
getTrackLink: () => cy.get("a[href='/track']"), | ||
getTitle: () => cy.get("[data-cy='page-header-title']"), | ||
getLogoTitle: () => cy.get("h1"), | ||
getUsernameInput: () => cy.get("input[name='username']"), | ||
getPasswordInput: () => cy.get("input[name='password']"), | ||
getFirstSigninButton: () => cy.get("button[class~=_button-login-id]"), | ||
getSecondSigninButton: () => cy.get("button[class~=_button-login-password]"), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import "@testing-library/cypress/add-commands"; | ||
|
||
Cypress.Commands.add("ignoreThirdpartyRequests", () => { | ||
cy.intercept(/.+sentry.+/, {}); // stubbed, never goes to the server | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./commands"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare namespace Cypress { | ||
interface Chainable { | ||
/** | ||
* Custom command to select DOM element by data-cy attribute. | ||
* @example cy.dataCy('greeting') | ||
*/ | ||
ignoreThirdpartyRequests(): Chainable<Element>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Then, When, Before } from "@badeball/cypress-cucumber-preprocessor"; | ||
import { pageDescriptor as homePageDescriptor } from "../../e2e/pageDescriptors/homePage"; | ||
|
||
const pages = { | ||
Home: homePageDescriptor, | ||
}; | ||
|
||
/* | ||
RTL descriptors and commands | ||
*/ | ||
function findByText(text: string) { | ||
return cy.findAllByText(new RegExp(text)); | ||
} | ||
|
||
function clickOnText(text: string) { | ||
return cy.findAllByText(new RegExp(text)).click(); | ||
} | ||
|
||
function textPresence(text: string) { | ||
findByText(text); | ||
} | ||
|
||
Before(() => { | ||
// cy.interceptPageLoad(); | ||
cy.ignoreThirdpartyRequests(); | ||
}); | ||
|
||
When("I perform a full login with user {string}", (userIdLiteral: string) => { | ||
cy.visit("/"); | ||
|
||
pages.Home.getLogoTitle().should("be.visible"); | ||
|
||
cy.login(userIdLiteral); | ||
}); | ||
|
||
When("I go to url {string}", (url: string) => { | ||
cy.visit(url, { failOnStatusCode: false }); | ||
}); | ||
|
||
When("I go to the {string} page", (pageName: string) => { | ||
cy.visit(pages[pageName].url); | ||
}); | ||
|
||
When("I login with user {string}", async (userIdLiteral: string) => { | ||
cy.login(userIdLiteral); | ||
}); | ||
|
||
Then("I should see the text {string}", textPresence); | ||
|
||
|
||
When("I click on the text {string}", (text: string) => { | ||
clickOnText(text); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.