-
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.
Merge pull request #18 from CirclesUBI/feature/app-460-fix-cypress-te…
…sts-in-app2 Feature/app 460 fix cypress tests in app2
- Loading branch information
Showing
29 changed files
with
1,423 additions
and
172 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
videos | ||
screenshots | ||
*.y4m | ||
*.y4m | ||
.history |
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,17 @@ | ||
import value from "../../fixtures/testData"; | ||
|
||
const enterLocationInput = "[data-cy=enterLocationInput]"; | ||
|
||
const googleMapSearch = { | ||
enterLocationInput, | ||
testGoogleMapSearch: () => { | ||
cy.get(enterLocationInput).type(value.location); | ||
cy.get(".pac-item", { timeout: 10000 }).should("be.visible"); | ||
cy.get(enterLocationInput).type("{downarrow}"); | ||
cy.get(enterLocationInput).type("{enter}"); | ||
|
||
cy.get("button[type='submit']").should("exist").click(); | ||
}, | ||
}; | ||
|
||
export default googleMapSearch; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const openPassport = () => { | ||
it("opens passport dapp", () => { | ||
it("opens passport dapp", { retries: 2 }, () => { | ||
cy.getByI18nKey("dapps.o-dashboard.pages.home.passport") | ||
.should("exist") | ||
.click(); | ||
}); | ||
} | ||
}; |
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,73 +1,65 @@ | ||
import { openPassport } from "../o-dashboard/openPassport"; | ||
import { openSideMenu } from "../openSideMenu"; | ||
import googleMapSearch from "../../components/googleMapSearch.cy"; | ||
import { getRandomPersonName } from "../../../src/utils/randomNames"; | ||
|
||
export const profileSettings = () => { | ||
describe("profile settings", () => { | ||
const editPhoto = "[data-cy=editPhoto]"; | ||
const randomName = getRandomPersonName(); | ||
|
||
let randNum = Math.floor(Math.random() * 9) + 1; | ||
|
||
export const profileSettings = () => { | ||
describe("profile settings", () => { | ||
openPassport(); | ||
|
||
|
||
|
||
it("sets new first- and last-name", () => { | ||
|
||
cy.getByClass("text-2xl cursor-pointer sm:text-4xl font-heading") | ||
.should("exist") | ||
.click(); | ||
|
||
cy.get("input").clear().type("firstnametest"); | ||
cy.get("input").clear().type(randomName.firstName); | ||
|
||
cy.get("button[type=submit]").should("exist").click(); | ||
// cy.contains("Save").should("exist").click(); | ||
|
||
cy.get("input").clear().type("lastnametest"); | ||
cy.get("input").clear().type(randomName.lastName); | ||
|
||
cy.get("button[type=submit]").should("exist").click(); | ||
// cy.contains("Save").should("exist").click(); | ||
}); | ||
|
||
it("sets new location", { retries: 4 }, () => { | ||
|
||
cy.getByClass("mt-1 text-sm text-center cursor-pointer") | ||
.should("exist") | ||
.click(); | ||
|
||
cy.wait(1000); | ||
|
||
cy.get("input[id='pacInput']").clear().wait(1000).type("Bandar"); | ||
|
||
cy.get(".pac-item-query").should("exist").first().click(); | ||
|
||
cy.get("button[type=submit]").should("exist").click(); | ||
googleMapSearch.testGoogleMapSearch(); | ||
}); | ||
|
||
// it("sets new profile picture", () => { | ||
|
||
|
||
// cy.getByClass("relative w-28 h-28 m-auto bg-white rounded-full") | ||
// .should("exist") | ||
// .click(); | ||
|
||
// cy.getByClass("input[type=file]").should("exist").click(); | ||
// cy.wait(1000); | ||
|
||
// if (checkIfElementExists("relative inline-flex")) { | ||
// cy.getByClass("table-cell w-10 h-10 align-middle bg-black rounded-full text-primary bg-opacity-60") | ||
// .should("exist") | ||
// .click(); | ||
// } else { | ||
// cy.get("input[type=file]").selectFile("./cypress/static/image.png", { | ||
// force: true, | ||
// }); | ||
// } | ||
it("opens photo editor", () => { | ||
cy.getByClass("relative w-28 h-28 m-auto bg-white rounded-full") | ||
.should("exist") | ||
.click(); | ||
}); | ||
|
||
it("sets new profile picture", () => { | ||
cy.get(editPhoto).should("exist").click(); | ||
cy.get("input[type=file]").should("exist"); | ||
|
||
cy.get("input[type=file]").selectFile( | ||
"./cypress/static/" + randNum + ".jpg", | ||
{ | ||
force: true, | ||
} | ||
); | ||
|
||
// cy.contains("Submit").click(); | ||
// }); | ||
cy.get(".btn").should("exist").contains("Simpan").click(); | ||
}); | ||
|
||
it("opens accounts from side-menu checks if circles-address is expandable", () => { | ||
openSideMenu("bg-passport"); | ||
}); | ||
}); | ||
}; | ||
}; |
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,51 +1,48 @@ | ||
import { getRandomPersonName } from "../../src/utils/randomNames"; | ||
import { survey } from "./survey"; | ||
|
||
import googleMapSearch from "../components/googleMapSearch.cy"; | ||
|
||
const randomName = getRandomPersonName(); | ||
|
||
export const signUp = () => { | ||
cy.getByI18nKey("shared.molecules.nextNav.components.loginPill.signInNow") | ||
.should("exist") | ||
.click(); | ||
|
||
cy.get("button[class='relative btn btn-block btn-primary']").should("exist").click(); | ||
|
||
//cy.contains("Login with Apple").should("exist").click(); | ||
cy.get("button[class='relative btn btn-block btn-primary']") | ||
.should("exist") | ||
.click(); | ||
|
||
cy.get("input").each(($input) => { | ||
cy.wrap($input).type("1"); | ||
}); | ||
cy.get("input") | ||
.should("exist") | ||
.each(($input) => { | ||
cy.wrap($input).type("1"); | ||
}); | ||
|
||
cy.get("button[type=submit]").should("exist").click(); | ||
|
||
survey(); | ||
|
||
cy.getByI18nKey("shared.molecules.nextNav.components.loginPill.signInNow").should("exist").click(); | ||
|
||
// Get all 'button' elements and filter them by their text valuz | ||
cy.getByI18nKey("shared.molecules.nextNav.components.loginPill.signInNow") | ||
.should("exist") | ||
.click(); | ||
|
||
cy.get("button").eq(0).click(); | ||
|
||
//const name = getRandomPersonName(); | ||
cy.getById("firstName").type("John"); | ||
cy.getById("firstName").type(randomName.firstName); | ||
|
||
cy.get("button[type='submit']").click(); | ||
|
||
cy.getById("lastName").type("Doe"); | ||
cy.getById("lastName").type(randomName.lastName); | ||
|
||
cy.get("button[type='submit']").click(); | ||
|
||
cy.get("input[type=file]").selectFile("./cypress/static/Person.png", { | ||
force: true, | ||
}); | ||
|
||
cy.get("button[class='btn transition-all overflow-hidden transform relative btn-primary svelte-12kbnbk px-8']").click(); | ||
|
||
it("sets the location", { retries: 3 }, () => { | ||
cy.getById("pacInput").type("Angkah selemadeg barat"); | ||
cy.get(".pac-item", { timeout: 10000 }) | ||
.should("be.visible") | ||
.first() | ||
.click(); | ||
}); | ||
cy.get(".btn").contains("Simpan").click(); | ||
|
||
cy.get("button[type='submit']").click({ force: true }); | ||
googleMapSearch.testGoogleMapSearch(); | ||
}; |
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.