-
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.
Adding Dockerfile and README
- Loading branch information
Showing
10 changed files
with
124 additions
and
61 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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
node_modules/ | ||
.env.local | ||
cypress.env.json | ||
screenshots |
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,11 @@ | ||
FROM cypress/browsers:node-18.14.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 | ||
|
||
WORKDIR /e2e | ||
|
||
COPY cypress.config.js . | ||
COPY package.json ./ | ||
COPY ./cypress ./cypress | ||
|
||
RUN npm install | ||
|
||
ENTRYPOINT ["npx", "cypress", "run"] |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
# ui-tests | ||
# UI tests | ||
|
||
1. Create the docker image | ||
|
||
```bash | ||
docker buildx build . -t ui-tests | ||
``` | ||
|
||
2. Run the docker image with the tests | ||
|
||
```bash | ||
docker run -it ui-test:latest | ||
``` |
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 |
---|---|---|
@@ -1,61 +1,53 @@ | ||
import ProfileComponent from "../pages/components/profileComponent"; | ||
import LoginPage from "../pages/loginPage"; | ||
import { faker } from "@faker-js/faker"; | ||
import { LANGUAGE_VALUE } from "../utils/languageConstants"; | ||
|
||
describe("User access to the app", () => { | ||
before(() => { | ||
|
||
|
||
// cy.visit("/"); | ||
|
||
// cy.get("button[type=submit]").click(); | ||
// cy.location("pathname").should("to.eq", "/account/dashboard/"); | ||
cy.setCookie( | ||
"osano_consentmanager", | ||
"Y-2LQKHu5l8pKISjBI0luyEyEPtc5MphuRgXDxmhq7qLNIGmRqZnXbYwPnmwZ9Ppc0WpWu51nRWKYBfoHSAP6pfdY-YMXjPF2XLUGeAN2nMHqY-euby0spvUlTQX3X7YTZ_UHWspbyfTuBp9tQ8UtORUYpnm07Kq_sdFX6kS6xGAPNe0w5j3YoiwhobtIXJ7oaWHID260lZ_mCcn8eAsKPhKFbLx3d5zxMCtNCqmtIuCHLuGEYENdO-_59cBCq0zNDJZJQDaEQiNj0YDeWax9r7UmsBar_-GLhn6dA==" | ||
); | ||
cy.setCookie( | ||
"osano_consentmanager_uuid", | ||
"ccff8d73-3ca7-48b7-865b-d64efc82c674" | ||
); | ||
describe("Logged in user flow", () => { | ||
beforeEach(() => { | ||
cy.acceptCookies(); | ||
cy.visit("/"); | ||
}); | ||
|
||
// it("should successfully log in with valid credentials and log out", () => { | ||
// cy.visit("/"); | ||
// const profileComponent = new ProfileComponent(); | ||
// profileComponent.logout(); | ||
// cy.contains("Login").and("be.visible"); | ||
// cy.findByRole("paragraph") | ||
// .should("contain", "You have successfully logged out.") | ||
// .and("be.visible"); | ||
// //getByRole('paragraph') | ||
// ///getByRole('heading', { name: 'You have entered an incorrect' }) | ||
// }); | ||
it("should successfully log in with valid credentials and log out", () => { | ||
const profileComponent = new ProfileComponent(); | ||
const loginPage = new LoginPage(); | ||
loginPage.doLogin(Cypress.env("user"), Cypress.env("pass")); | ||
profileComponent.logout(); | ||
cy.contains("Login").and("be.visible"); | ||
cy.getParagraphMessage() | ||
.should("contain", "You have successfully logged out.") | ||
.and("be.visible"); | ||
cy.getHeaderMessage() | ||
.should("contain", "You have successfully logged out.") | ||
.and("be.visible"); | ||
}); | ||
|
||
// it("should show an error message with invalid credentials", () => { | ||
// cy.visit("/"); | ||
// const loginPage = new LoginPage(); | ||
// loginPage.login("notAUser", "wrong pass"); | ||
// cy.get(".cbox_messagebox_error") | ||
// .should("contain", "You have entered an incorrect username or password.") | ||
// .and("be.visible"); | ||
// }); | ||
it("should show an error message with invalid credentials", () => { | ||
const loginPage = new LoginPage(); | ||
loginPage.doLogin(faker.internet.userName(), faker.internet.password()); | ||
cy.getParagraphMessage() | ||
.should("contain", "You have entered an incorrect username or password.") | ||
.and("be.visible"); | ||
cy.getHeaderMessage() | ||
.should("contain", "You have entered an incorrect username or password.") | ||
.and("be.visible"); | ||
}); | ||
|
||
it("should maintain user preferred language when changing language in login page", () => { | ||
cy.visit("/"); | ||
const loginPage = new LoginPage(); | ||
loginPage.changeLanguage(LANGUAGE_VALUE.IT); | ||
cy.intercept("GET", "/v7/identity/users/current_user/").as("userData"); | ||
|
||
|
||
loginPage.doLogin(Cypress.env("user"), Cypress.env("pass")); | ||
const profileComponent = new ProfileComponent(); | ||
cy.wait("@userData").then(({ response }) => { | ||
cy.log(response); | ||
expect(response.body.preferred_language).to.exist; | ||
expect(response.body.preferred_language).to.eq("en_US"); | ||
}); | ||
profileComponent.seeLanguage(); | ||
cy.get('[id=en_US-language-item-form]').find( | ||
".language-switch__selected-indicator" | ||
); | ||
profileComponent | ||
.getSelectedLanguage(LANGUAGE_VALUE.EN) | ||
.should("be.visible"); | ||
}); | ||
}); |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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