-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
218de20
commit d6a51e5
Showing
2 changed files
with
121 additions
and
0 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,46 @@ | ||
{ | ||
"cookies": [], | ||
"origins": [ | ||
{ | ||
"origin": "http://localhost:3000", | ||
"localStorage": [ | ||
{ | ||
"name": "checkedIn", | ||
"value": "yes" | ||
}, | ||
{ | ||
"name": "language", | ||
"value": "\"en\"" | ||
}, | ||
{ | ||
"name": "lastRefresh", | ||
"value": "02/10/2023" | ||
}, | ||
{ | ||
"name": "theme", | ||
"value": "{\"light\":1,\"dark\":1}" | ||
}, | ||
{ | ||
"name": "darkMode", | ||
"value": "off" | ||
}, | ||
{ | ||
"name": "installId", | ||
"value": "8e79de41-5c85-4fba-b175-e95f5635123d" | ||
}, | ||
{ | ||
"name": "dexieVersion", | ||
"value": "12" | ||
}, | ||
{ | ||
"name": "i18nextLng", | ||
"value": "en" | ||
}, | ||
{ | ||
"name": "confirmationState", | ||
"value": "{\"open\":false,\"goal\":{\"archive\":true,\"delete\":true,\"shareAnonymously\":true,\"shareWithOne\":true},\"collaboration\":{\"colabRequest\":true,\"delete\":true,\"archive\":true}}" | ||
} | ||
] | ||
} | ||
] | ||
} |
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,75 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test("test", async ({ browser }) => { | ||
test.setTimeout(40000); | ||
const userOneContext = await browser.newContext({ | ||
storageState: "./auth.json", | ||
serviceWorkers: "allow", | ||
}); | ||
const userTwoContext = await browser.newContext({ | ||
storageState: "./auth.json", | ||
serviceWorkers: "allow", | ||
}); | ||
const userTwoPage = await userTwoContext.newPage(); | ||
const userOnePage = await userOneContext.newPage(); | ||
await userOnePage.goto("http://localhost:3000/"); | ||
await userOnePage.getByRole("button", { name: "Goals" }).click(); | ||
await userOnePage.locator(".goal-tile").first().click(); | ||
await userOnePage | ||
.locator("div") | ||
.filter({ hasText: /^ActionsEdit$/ }) | ||
.locator("div") | ||
.nth(2) | ||
.click(); | ||
await userOnePage | ||
.locator("div") | ||
.filter({ hasText: /^Share$/ }) | ||
.first() | ||
.click(); | ||
await userOnePage.getByRole("button", { name: "Share privately" }).click(); | ||
await userOnePage.getByRole("button", { name: "Choose contact" }).click(); | ||
await userOnePage.getByPlaceholder("Name").click(); | ||
await userOnePage.getByPlaceholder("Name").fill("User 2"); | ||
await userOnePage.getByRole("button", { name: "add contact Share invitation" }).click(); | ||
await userOnePage.waitForTimeout(5000); | ||
await userOnePage.goBack(); | ||
await userOnePage.getByRole("button", { name: "U", exact: true }).click(); | ||
await userOnePage.waitForSelector(".ant-notification-notice"); | ||
const link = await userOnePage.evaluate("navigator.clipboard.readText()"); | ||
await userOnePage.goto("http://localhost:3000/"); | ||
await userOnePage.getByRole("button", { name: "Goals" }).click(); | ||
await userOnePage.locator(".goal-tile").first().click(); | ||
await userOnePage | ||
.locator("div") | ||
.filter({ hasText: /^ActionsEdit$/ }) | ||
.locator("div") | ||
.nth(2) | ||
.click(); | ||
await userOnePage | ||
.locator("div") | ||
.filter({ hasText: /^Share$/ }) | ||
.first() | ||
.click(); | ||
await userOnePage.getByRole("button", { name: "Share privately" }).click(); | ||
await userOnePage.getByRole("button", { name: "Choose contact" }).click(); | ||
|
||
await userTwoPage.waitForTimeout(1000); | ||
await userTwoPage.goto(`${link}`); | ||
await userTwoPage.getByPlaceholder("Contact name").click(); | ||
await userTwoPage.getByPlaceholder("Contact name").fill("User 1"); | ||
await userTwoPage.getByRole("button", { name: "Add to my contacts" }).click(); | ||
await userTwoPage.waitForTimeout(2000); | ||
await userOnePage.getByRole("button", { name: "U", exact: true }).click(); | ||
await userOnePage.waitForSelector(".ant-notification-notice"); | ||
|
||
await userTwoPage.reload(); // Refresh the window | ||
await userTwoPage.getByRole("button", { name: "Goals" }).click(); | ||
await userTwoPage.getByRole("button", { name: "Schedule" }).click(); | ||
await userTwoPage.getByRole("button", { name: "Goals" }).click(); // Switch back to My Goals | ||
await userTwoPage.reload(); // Refresh the window | ||
await userTwoPage.waitForSelector(".header-icon[alt='zinzen inbox']"); | ||
await userTwoPage.waitForSelector(".header-icon[alt='zinzen inbox']"); // Check if inbox icon is visible | ||
await userTwoPage.getByRole("button", { name: "zinzen inbox" }).click(); // Click on inbox | ||
await userTwoPage.waitForSelector(".goal-tile"); | ||
}); | ||
|