Skip to content

Commit b6e5705

Browse files
committed
Merge branch 'main' into 2091-map-proposal-elements-for-testing
2 parents 1292ab0 + 2b4cf67 commit b6e5705

36 files changed

+312
-159
lines changed

catalyst_voices/apps/voices/e2e_tests/pageobject/app-bar-page.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { Locator, Page } from "@playwright/test";
2+
import intlEn from "./onboarding/localization-util";
23

34
export class AppBarPage {
45
getStartedBtn: Locator;
56
page: Page;
6-
7+
78
constructor(page: Page) {
89
this.page = page;
910
this.getStartedBtn = page.getByRole("button", {
10-
name: "GetStartedButton-test",
11+
name: intlEn.getStarted,
1112
});
1213
}
1314
async GetStartedBtnClick() {

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-14-keychain-final.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Locator, Page } from "@playwright/test";
22
import { OnboardingBasePage } from "../onboarding-base-page";
33
import { PasswordInputPanel } from "./step-13-password-input";
4+
import intlEn from "../localization-util";
45

56
export class KeychainFinalPanel {
67
page: Page;
@@ -9,20 +10,14 @@ export class KeychainFinalPanel {
910
constructor(page: Page) {
1011
this.page = page;
1112
this.linkWalletAndRolesBtn = this.page.getByRole("button", {
12-
name: "LinkWalletAndRoles-test",
13+
name: intlEn.createKeychainLinkWalletAndRoles,
1314
});
1415
}
1516

16-
async goto() {
17+
async goto(password: string) {
1718
await new PasswordInputPanel(this.page).goto();
18-
19-
await new PasswordInputPanel(this.page).fillPassword(
20-
new OnboardingBasePage(this.page).password
21-
);
22-
23-
await new PasswordInputPanel(this.page).fillConfirmPassword(
24-
new OnboardingBasePage(this.page).password
25-
);
19+
await new PasswordInputPanel(this.page).fillPassword(password);
20+
await new PasswordInputPanel(this.page).fillConfirmPassword(password);
2621
await this.page.waitForTimeout(1000);
2722

2823
await new OnboardingBasePage(this.page).nextButton.click();

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-15-link-wallet-info.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Locator, Page } from "@playwright/test";
22
import { KeychainFinalPanel } from "./step-14-keychain-final";
3+
import intlEn from "../localization-util";
34

45
export class LinkWalletInfoPanel {
56
page: Page
@@ -8,12 +9,12 @@ export class LinkWalletInfoPanel {
89
constructor(page: Page) {
910
this.page = page;
1011
this.chooseWalletBtn = this.page.getByRole("button", {
11-
name: "ChooseCardanoWalletButton",
12+
name: intlEn.chooseCardanoWallet,
1213
});
1314
}
1415

15-
async goto() {
16-
await new KeychainFinalPanel(this.page).goto();
16+
async goto(password: string) {
17+
await new KeychainFinalPanel(this.page).goto(password);
1718
await new KeychainFinalPanel(this.page).clickLinkWalletAndRolesBtn();
1819
}
1920

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-16-wallet-list.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { Locator, Page } from "@playwright/test";
22
import { LinkWalletInfoPanel } from "./step-15-link-wallet-info";
3+
import intlEn from "../localization-util";
34

45
export class WalletListPanel {
56
page: Page;
67
yoroiWallet: Locator;
78

89
constructor(page: Page) {
910
this.page = page;
10-
this.yoroiWallet = page.locator(
11-
'role=group[name="Wallets"] >> role=button'
12-
);
11+
this.yoroiWallet = page.getByRole("button", {
12+
name:'yoroi',
13+
});
1314
}
1415

15-
async goto() {
16-
await new LinkWalletInfoPanel(this.page).goto();
16+
async goto(password: string) {
17+
await new LinkWalletInfoPanel(this.page).goto(password);
1718
await new LinkWalletInfoPanel(this.page).clickChooseWalletBtn();
1819
}
1920

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-17-choose-wallet.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@ import { Page } from "@playwright/test";
22
import { WalletListPanel } from "./step-16-wallet-list";
33

44
export class WalletPopupSelection {
5-
page: Page
5+
page: Page;
66

7-
constructor(page) {
8-
this.page = page;
9-
}
7+
constructor(page) {
8+
this.page = page;
9+
}
1010

11-
async goto() {
12-
await new WalletListPanel(this.page).goto();
13-
await new WalletListPanel(this.page).clickYoroiWallet();
14-
}
15-
async clickWalletPopup() {
16-
const [walletPopup] = await Promise.all([
17-
browser.waitForEvent("page"),
18-
new WalletListPanel(page).clickYoroiWallet(),
19-
]);
20-
}
21-
}
11+
async goto(password: string) {
12+
await new WalletListPanel(this.page).goto(password);
13+
await new WalletListPanel(this.page).clickYoroiWallet();
14+
}
15+
}

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-2-base-profile-info.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Locator, Page } from "@playwright/test";
2+
import intlEn from "../localization-util";
23
import { GetStartedPanel } from "../step-1-get-started";
34

45
export class BaseProfileInfoPanel {
@@ -8,7 +9,7 @@ export class BaseProfileInfoPanel {
89
constructor(page: Page) {
910
this.page = page;
1011
this.createYourBaseProfileBtn = page.getByRole("button", {
11-
name: "CreateBaseProfileNext-test",
12+
name: intlEn.createBaseProfileInstructionsNext,
1213
});
1314
}
1415

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-5-base-profile-final.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Locator, Page } from "@playwright/test";
2+
import intlEn from "../localization-util";
23
import { AcknowledgementsPanel } from "./step-4-acknowledgements";
34

45
export class BaseProfileFinalPanel {
@@ -8,7 +9,7 @@ export class BaseProfileFinalPanel {
89
constructor(page: Page) {
910
this.page = page;
1011
this.createYourCatalystKeychainBtn = page.getByRole("button", {
11-
name: "CreateKeychain-test",
12+
name: intlEn.accountCreationSplashTitle,
1213
});
1314
}
1415

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-6-catalyst-keychain-info.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Locator, Page } from "@playwright/test";
2+
import intlEn from "../localization-util";
23
import { BaseProfileFinalPanel } from "./step-5-base-profile-final";
34

45
export class CatalystKeychainInfoPanel {
@@ -8,7 +9,7 @@ export class CatalystKeychainInfoPanel {
89
constructor(page: Page) {
910
this.page = page;
1011
this.createCatalystKeychainNowBtn = page.getByRole("button", {
11-
name: "CreateKeychainNow-test",
12+
name: intlEn.accountCreationSplashNextButton,
1213
});
1314
}
1415

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as fs from "fs";
2+
import * as path from "path";
3+
4+
// Calculate the path to your ARB file (adjust levels as needed)
5+
const arbFilePath = path.join(
6+
__dirname,
7+
"../../../../../packages/internal/catalyst_voices_localization/lib/l10n/intl_en.arb"
8+
);
9+
10+
// Load and parse the ARB file
11+
const rawContent = fs.readFileSync(arbFilePath, "utf8");
12+
const intlEn: Record<string, any> = JSON.parse(rawContent);
13+
14+
// Export the parsed data
15+
export default intlEn;
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
import { type Locator, type Page } from "@playwright/test";
2+
import intlEn from "./localization-util";
23

34
export class OnboardingBasePage {
45
page: Page;
56
nextBtnGroup: Locator;
67
nextButton: Locator;
7-
setUnlockPasswordGroup: Locator;
8-
setUnlockPasswordBtn: Locator;
9-
password: string;
108

119
constructor(page: Page) {
1210
this.page = page;
13-
this.nextBtnGroup = page.getByRole("group", { name: "NextButton-test" });
14-
this.nextButton = this.nextBtnGroup.locator('role=button[name="Next"]');
15-
this.setUnlockPasswordGroup = page.getByRole("group", {
16-
name: "SetUnlockPasswordButton",
17-
});
18-
this.setUnlockPasswordBtn =
19-
this.setUnlockPasswordGroup.locator("role=button");
20-
this.password = "emiride1234";
11+
this.nextBtnGroup = page.getByRole("button", { name: "Next Button" });
12+
this.nextButton = page.locator('role=button[name="' + intlEn.next + '"]');
2113
}
2214
}

0 commit comments

Comments
 (0)