Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2e move locators 2 #2981

Merged
merged 26 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f311a17
Added first batch of locators to page objects
cmerloglb Aug 26, 2022
d625a4c
Moved more locators to corresponding pages
cmerloglb Aug 29, 2022
81dc284
Moved more locators to corresponding pages
cmerloglb Aug 30, 2022
4398fcf
Added first batch of locators to page objects
cmerloglb Aug 26, 2022
18940ae
Moved more locators to corresponding pages
cmerloglb Aug 29, 2022
6291a3a
Moved more locators to corresponding pages
cmerloglb Aug 30, 2022
32444d3
Added changes to fix errors
cmerloglb Aug 30, 2022
3a3c1d6
Merged branches
cmerloglb Aug 30, 2022
2d15fb0
Fixed issue with lint
cmerloglb Aug 30, 2022
ed9e638
Merge branch 'develop' into e2e-move-locators-2
Nebyt Sep 14, 2022
ea00a2a
Updated addresses-generation-steps.js and walletReceivePage.js
Nebyt Sep 16, 2022
c1b2c4e
Updated basicSetupPage.js, common-steps.js, general-settings-steps.js…
Nebyt Sep 16, 2022
a271e24
Updated installation-procedure-steps.js, main-ui-steps.js, walletPage…
Nebyt Sep 16, 2022
7c2fac1
Updated memo-steps.js, walletSendPage.js
Nebyt Sep 16, 2022
07f9ef9
Updated basicSetupPage.js, select-language-steps.js
Nebyt Sep 16, 2022
8e75cb1
Updated commonDialogPage.js, settingsPage.js, settings-ui-steps.js
Nebyt Sep 16, 2022
89f79d4
Updated several files
Nebyt Sep 16, 2022
d78ad63
Merge remote-tracking branch 'origin/e2e-move-locators-2' into e2e-mo…
Nebyt Sep 16, 2022
989887c
Merge branch 'develop' into e2e-move-locators-2
Nebyt Oct 3, 2022
d2df292
Fixes after merging
Nebyt Oct 3, 2022
0238ec6
Flow fixes
Nebyt Oct 3, 2022
53fd70e
Fixes wallet restoration
Nebyt Oct 3, 2022
18c615a
Fixed switching to the revamp version
Nebyt Oct 3, 2022
74f5779
Fixed locator
Nebyt Oct 3, 2022
05e2154
Flow fix
Nebyt Oct 3, 2022
cbe7b64
Eslint fix
Nebyt Oct 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@ export default class ThemeSettingsBlock extends Component<Props> {
value={OLD_THEME}
control={<Radio size='small' />}
label={intl.formatMessage(messages.currentVersion)}
id="switchToOldVersionButton"
sx={{
marginRight: '20px'
}}
/>
<FormControlLabel
value={NEW_THEME}
control={<Radio id="switchToRevampButton" size='small' />}
control={<Radio size='small' />}
label={intl.formatMessage(messages.newVersion)}
id="switchToNewVersionButton"
/>
</RadioGroup>
</Box>
Expand Down
39 changes: 39 additions & 0 deletions packages/yoroi-extension/features/pages/basicSetupPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// @flow

import type { LocatorObject } from '../support/webdriver';
import { By } from 'selenium-webdriver';

const LANGUAGE_SELECTION_FORM = '.LanguageSelectionForm_component';

// language select page
export const languageSelectionForm: LocatorObject = {
locator: LANGUAGE_SELECTION_FORM,
method: 'css',
};

export const languageSelectionFromDropdown: LocatorObject = {
locator: `${LANGUAGE_SELECTION_FORM} .MuiInputBase-input`,
method: 'css',
};

export const japaneseLaguageSelection: LocatorObject = {
locator: '//span[contains(text(), "日本語")]',
method: 'xpath',
};

export const continueButton: LocatorObject = {
locator: '//button[text()="Continue"]',
method: 'xpath',
};
// ToS page
export const termsOfUseComponent: LocatorObject = {
locator: '.TermsOfUseForm_component',
method: 'css',
};
export const getTosCheckbox = async (customWorld: Object): Promise<any> => {
const tosClassElement = await customWorld.findElement(termsOfUseComponent);
return await tosClassElement.findElement(By.xpath('//input[@type="checkbox"]'));
};

// uri prompt page
export const walletAddComponent: LocatorObject = { locator: '.WalletAdd_component', method: 'css' };
21 changes: 21 additions & 0 deletions packages/yoroi-extension/features/pages/commonDialogPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @flow

import type { LocatorObject } from '../support/webdriver';
import { By } from 'selenium-webdriver';

export const primaryButton: LocatorObject = { locator: '.primary', method: 'css' };
export const errorBlockComponent: LocatorObject = {
locator: '.ErrorBlock_component',
method: 'css',
};
export const dialogTitle: LocatorObject = { locator: '.dialog__title', method: 'css' };

export const warningCheckboxElement: LocatorObject = {
locator: '.DangerousActionDialog_checkbox',
method: 'css',
};

export const getWarningCheckbox = async (customWorld: Object): Promise<webdriver$WebElement> => {
const warningCheckboxComponent = await customWorld.findElement(warningCheckboxElement);
return await warningCheckboxComponent.findElement(By.xpath('//input[@type="checkbox"]'));
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @flow

export const feeField = { locator: '.TransferSummaryPage_fees', method: 'css' };
export const amountField = { locator: '.TransferSummaryPage_amount', method: 'css' };
export const totalAmountField = { locator: '.TransferSummaryPage_totalAmount', method: 'css' };
import type { LocatorObject } from '../support/webdriver';

export const feeField: LocatorObject = { locator: '.TransferSummaryPage_fees', method: 'css' };
export const amountField: LocatorObject = { locator: '.TransferSummaryPage_amount', method: 'css' };
export const totalAmountField: LocatorObject = {
locator: '.TransferSummaryPage_totalAmount',
method: 'css',
};
17 changes: 17 additions & 0 deletions packages/yoroi-extension/features/pages/daedalusTransferPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @flow

import type { LocatorObject } from '../support/webdriver';

export const nextButton: LocatorObject = {
locator: "//button[contains(@label, 'Next')]",
method: 'xpath',
};
export const backButton: LocatorObject = {
locator: "//button[contains(@label, 'Back')]",
method: 'xpath',
};
export const formFieldOverridesClassicError: LocatorObject = {
locator: '.FormFieldOverridesClassic_error',
method: 'css',
};
export const transferButton: LocatorObject = { locator: '.transferButton', method: 'css' };
6 changes: 4 additions & 2 deletions packages/yoroi-extension/features/pages/errorPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @flow

export const errorPageTitle = { locator: '.ErrorPage_title', method: 'css' };
export const errorMessage = { locator: '.ErrorPage_error', method: 'css' };
import type { LocatorObject } from '../support/webdriver';

export const errorPageTitle: LocatorObject = { locator: '.ErrorPage_title', method: 'css' };
export const errorMessage: LocatorObject = { locator: '.ErrorPage_error', method: 'css' };
12 changes: 12 additions & 0 deletions packages/yoroi-extension/features/pages/mainWindowPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @flow

import type { LocatorObject } from '../support/webdriver';

export const yoroiClassic: LocatorObject = { locator: '.YoroiClassic', method: 'css' };
export const serverErrorBanner: LocatorObject = {
locator: '.ServerErrorBanner_serverError',
method: 'css',
};
export const maintenanceBody: LocatorObject = { locator: '.Maintenance_body', method: 'css' };

export const myWalletsPage: LocatorObject = { locator: '.MyWallets_page', method: 'css' };
189 changes: 166 additions & 23 deletions packages/yoroi-extension/features/pages/newWalletPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,181 @@
import type { LocatorObject } from '../support/webdriver';

export const connectHwButton: LocatorObject = { locator: '.WalletAdd_btnConnectHW', method: 'css' };
export const createWalletButton: LocatorObject = { locator: '.WalletAdd_btnCreateWallet', method: 'css' };
export const restoreWalletButton: LocatorObject = { locator: '.WalletAdd_btnRestoreWallet', method: 'css' };
export const createWalletButton: LocatorObject = {
locator: '.WalletAdd_btnCreateWallet',
method: 'css',
};
export const restoreWalletButton: LocatorObject = {
locator: '.WalletAdd_btnRestoreWallet',
method: 'css',
};
// Currency options dialog
export const pickUpCurrencyDialog: LocatorObject = { locator: '.PickCurrencyOptionDialog', method: 'css' };
export const pickUpCurrencyDialog: LocatorObject = {
locator: '.PickCurrencyOptionDialog',
method: 'css',
};
export const pickUpCurrencyDialogErgo: LocatorObject = {
locator: '.PickCurrencyOptionDialog_ergo',
method: 'css',
};
export const pickUpCurrencyDialogCardano: LocatorObject = {
locator: '.PickCurrencyOptionDialog_cardano',
method: 'css',
};
export const walletRestoreOptionDialog: LocatorObject = {
locator: '.WalletRestoreOptionDialog',
method: 'css',
};
export const restoreNormalWallet: LocatorObject = {
locator: '.WalletRestoreOptionDialog_restoreNormalWallet',
method: 'css',
};
export const restore24WordWallet: LocatorObject = {
locator: '.WalletRestoreOptionDialog_normal24WordWallet',
method: 'css',
};
export const walletRestoreDialog: LocatorObject = {
locator: '.WalletRestoreOptionDialog',
method: 'css',
};
export const getCurrencyButton = (currency: string): LocatorObject => {
return { locator: `.PickCurrencyOptionDialog_${currency}`, method: 'css' };
return { locator: `.PickCurrencyOptionDialog_${currency}`, method: 'css' };
};
// Create options dialog
export const createOptionDialog: LocatorObject = { locator: '.WalletCreateOptionDialog', method: 'css' };
export const createNormalWalletButton: LocatorObject = { locator: '.WalletCreateOptionDialog_createWallet', method: 'css' };
export const createPaperWalletButton: LocatorObject = { locator: '.WalletCreateOptionDialog_restorePaperWallet', method: 'css' };

// Restore options dialog
export const restoreOptionDialog: LocatorObject = { locator: '.WalletRestoreOptionDialog', method: 'css' };
export const normalWordWalletButton: LocatorObject = { locator: '.WalletRestoreOptionDialog_restoreNormalWallet', method: 'css' };

// HW options dialog
export const hwOptionsDialog: LocatorObject = { locator: '.WalletConnectHWOptionDialog', method: 'css' };
export const ledgerWalletButton: LocatorObject = { locator: '.WalletConnectHWOptionDialog_connectLedger', method: 'css' };
export const trezorWalletButton: LocatorObject = { locator: '.WalletConnectHWOptionDialog_connectTrezor', method: 'css' };

export const hwOptionsDialog: LocatorObject = {
locator: '.WalletConnectHWOptionDialog',
method: 'css',
};
export const ledgerWalletButton: LocatorObject = {
locator: '.WalletConnectHWOptionDialog_connectLedger',
method: 'css',
};
export const trezorWalletButton: LocatorObject = {
locator: '.WalletConnectHWOptionDialog_connectTrezor',
method: 'css',
};
// Era options dialog
export const eraOptionsDialog: LocatorObject = { locator: '.WalletEraOptionDialog', method: 'css' };
export const shelleyEraButton: LocatorObject = { locator: '.WalletEraOptionDialog_bgShelleyMainnet', method: 'css' };
export const byronEraButton: LocatorObject = { locator: '.WalletEraOptionDialog_bgByronMainnet', method: 'css' };

export const shelleyEraButton: LocatorObject = {
locator: '.WalletEraOptionDialog_bgShelleyMainnet',
method: 'css',
};
export const byronEraButton: LocatorObject = {
locator: '.WalletEraOptionDialog_bgByronMainnet',
method: 'css',
};
// Trezor connect dialog
export const trezorConnectDialog: LocatorObject = { locator: '.CheckDialog', method: 'css' };
export const trezorWalletName: LocatorObject = { locator: '//input[@name="walletName"]', method: 'xpath' };
export const trezorWalletName: LocatorObject = {
locator: '//input[@name="walletName"]',
method: 'xpath',
};
export const trezorConfirmButton: LocatorObject = { locator: '.MuiButton-primary', method: 'css' };
// Create wallet dialog
export const createOptionDialog: LocatorObject = {
locator: '.WalletCreateOptionDialog',
method: 'css',
};
export const createNormalWalletButton: LocatorObject = {
locator: '.WalletCreateOptionDialog_createWallet',
method: 'css'
};
export const createPaperWalletButton: LocatorObject = {
locator: '.WalletCreateOptionDialog_restorePaperWallet',
method: 'css',
};
export const createWalletPasswordInput: LocatorObject = {
locator: '.WalletCreateDialog .walletPassword input',
method: 'css',
};
export const createWalletRepeatPasswordInput: LocatorObject = {
locator: '.WalletCreateDialog .repeatedPassword input',
method: 'css',
};
export const createPersonalWalletButton: LocatorObject = {
locator: '.WalletCreateDialog .primary',
method: 'css',
};
export const createWalletPasswordHelperText: LocatorObject = {
locator: '//p[starts-with(@id, "walletPassword") and contains(@id, "-helper-text")]',
method: 'xpath',
};
export const walletRecoveryPhraseMnemonicComponent: LocatorObject = {
locator: '.WalletRecoveryPhraseMnemonic_component',
method: 'css',
};
export const createWalletNameError: LocatorObject = {
locator: '.walletName .MuiFormHelperText-root',
method: 'css',
};
export const createWalletPasswordError: LocatorObject = {
locator: '.FormFieldOverridesClassic_error',
method: 'css',
};
export const securityWarning: LocatorObject = {
locator: '.MuiFormControlLabel-root',
method: 'css',
};

// Recovery Phrase dialog
export const recoveryPhraseButton: LocatorObject = {
locator: '.WalletRecoveryPhraseDisplayDialog .primary',
method: 'css',
};
export const recoveryPhraseConfirmButton: LocatorObject = {
locator: '//button[text()="Confirm"]',
method: 'xpath',
};
export const clearButton: LocatorObject = {
locator: "//button[contains(text(), 'Clear')]",
method: 'xpath',
};

// Paper Wallet dialog
export const paperWalletDialogSelect: LocatorObject = {
locator: '.WalletPaperDialog_component .MuiSelect-select',
method: 'css',
};
export const restorePaperWalletButton: LocatorObject = {
locator: '.WalletRestoreOptionDialog_restorePaperWallet',
method: 'css',
};
export const restoreDialogButton: LocatorObject = {
locator: '.WalletRestoreDialog .primary',
method: 'css',
};
export const getAddressesAmountButton = (addressesAmount: string): LocatorObject => {
return { locator: `//li[contains(text(), "${addressesAmount}")]`, method: 'xpath' };
};
export const recoveryPhraseDeleteIcon = {
locator: `(//span[contains(text(), '×')])[1]`,
method: 'xpath',
};
export const recoveryPhraseError: LocatorObject = {
locator: '//p[starts-with(@id, "recoveryPhrase--")]',
method: 'xpath',
};
export const addressElement : LocatorObject = {
locator: '//span[contains(@class, "RawHash_hash")]',
method: 'xpath',
};

// Common elements
export const walletNameInput: LocatorObject = { locator: '//input[@name="walletName"]', method: 'xpath' };
export const walletNameInput: LocatorObject = {
locator: '//input[@name="walletName"]',
method: 'xpath',
};
export const saveDialog: LocatorObject = { locator: '.SaveDialog', method: 'css' };
export const saveButton: LocatorObject = { locator: '//button[@id="primaryButton"]', method: 'xpath' };
export const saveButton: LocatorObject = {
locator: '//button[@id="primaryButton"]',
method: 'xpath',
};
export const checkDialog: LocatorObject = { locator: '.CheckDialog_component', method: 'css' };
export const sendConfirmationDialog: LocatorObject = {
locator: '.HWSendConfirmationDialog_dialog',
method: 'css',
};
export const walletAlreadyExistsComponent: LocatorObject = {
locator: '.WalletAlreadyExistDialog_component',
method: 'css',
};
Loading