Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ruslan/YOEXT-1433/removing-legac…
Browse files Browse the repository at this point in the history
…y-theme-functions' into ruslan/YOEXT-1432/remove-actions
  • Loading branch information
vsubhuman committed Dec 23, 2024
2 parents d62e95e + f73415e commit a741c7d
Show file tree
Hide file tree
Showing 37 changed files with 1,056 additions and 593 deletions.
9 changes: 8 additions & 1 deletion packages/e2e-tests/helpers/restoreWalletHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
serviceWorkersTabName,
WindowManager,
} from './windowManager.js';
import { quarterSecond } from './timeConstants.js';

export const restoreWallet = async (webdriver, logger, testWallet, shouldBeModalWindow = true) => {
const addNewWalletPage = new AddNewWallet(webdriver, logger);
Expand Down Expand Up @@ -134,6 +135,7 @@ export const restartServiceWorker = async (webdriver, logger) => {
await windowManager.openNewTab(serviceWorkersTabName, serviceWorkersLink);

const basepage = new BasePage(webdriver, logger);
await basepage.sleep(quarterSecond);

const stopBtnLocator = {
locator: '.stop',
Expand All @@ -145,7 +147,12 @@ export const restartServiceWorker = async (webdriver, logger) => {
};

const stopBtnElems = await basepage.findElements(stopBtnLocator);
const stopBtnElem = stopBtnElems[1];
let stopBtnElem;
if (stopBtnElems.length === 1) {
stopBtnElem = stopBtnElems[0];
} else {
stopBtnElem = stopBtnElems[1];
}
await stopBtnElem.click();

await basepage.sleep(500);
Expand Down
8 changes: 4 additions & 4 deletions packages/e2e-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@emurgo/cardano-serialization-lib-nodejs": "^12.0.0-alpha.26",
"bignumber.js": "^9.1.2",
"chai": "^4.3.10",
"chromedriver": "131.0.3",
"chromedriver": "131.0.4",
"cross-env": "^7.0.3",
"json-server": "^0.17.4",
"mocha": "^10.2.0",
Expand Down
17 changes: 12 additions & 5 deletions packages/e2e-tests/pages/wallet/walletTab/sendSubTab.page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import WalletTab from './walletTab.page.js';
import { quarterSecond, fiveSeconds, halfSecond } from '../../../helpers/timeConstants.js';
import { quarterSecond, fiveSeconds, halfSecond, defaultWaitTimeout } from '../../../helpers/timeConstants.js';

class SendSubTab extends WalletTab {
// locators
Expand Down Expand Up @@ -131,14 +131,21 @@ class SendSubTab extends WalletTab {
this.logger.info(`SendSubTab::receiverIsGood is called.`);
return await this.customWaitIsPresented(this.receiverDoneIcon, fiveSeconds, quarterSecond);
}
async receiverIsIncorrect() {
this.logger.info(`SendSubTab::receiverIsIncorrect is called.`);
return await this.customWaitIsPresented(this.receiverErrorIcon, fiveSeconds, quarterSecond);
}
async getReceiverHelperText() {
this.logger.info(`SendSubTab::getReceiverHelperText is called.`);
return await this.getText(this.receiverHelperTextLocator);
}
async waitReceiverHelperTextEqual(expectedText) {
this.logger.info(`SendSubTab::waitReceiverHelperTextEqual is called.`);
return await this.customWaiter(
async () => {
const currentText = await this.getReceiverHelperText();
return currentText === expectedText;
},
defaultWaitTimeout,
quarterSecond
);
}
async getReceiverHandlerAddress() {
this.logger.info(`SendSubTab::getReceiverHandlerAddress is called.`);
return await this.getText(this.domainResolverAddressTextLocator);
Expand Down
12 changes: 3 additions & 9 deletions packages/e2e-tests/test/27_handles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,10 @@ describe('Handle handles', function () {
await sendStep1Page.enterReceiver(testNegativeDatum.userHandle);
});

it(`${testNegativeDatum.provider}. Wait for domain resolver response`, async function () {
it(`${testNegativeDatum.provider}. Wait and check displayed info`, async function () {
const sendStep1Page = new SendSubTab(webdriver, logger);
const errorMarkIsDisplayed = await sendStep1Page.receiverIsIncorrect();
expect(errorMarkIsDisplayed, 'There is no error for receiver').to.be.true;
});

it(`${testNegativeDatum.provider}. Check displayed info and continue`, async function () {
const sendStep1Page = new SendSubTab(webdriver, logger);
const helperText = await sendStep1Page.getReceiverHelperText();
expect(helperText, 'A different error message is displayed').to.equal(RECEIVER_DOESNT_EXIST);
const errorMessageIsDisplayed = await sendStep1Page.waitReceiverHelperTextEqual(RECEIVER_DOESNT_EXIST);
expect(errorMessageIsDisplayed, 'A different error message is displayed').to.equal(true);
});
});
}
Expand Down
12 changes: 3 additions & 9 deletions packages/e2e-tests/test/28_invalidAddressToSend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,10 @@ describe('Invalid address for sending', function () {
await sendStep1Page.enterReceiver(invalidAddress);
});

it(`Wait for checking`, async function () {
it(`Wait and check displayed info`, async function () {
const sendStep1Page = new SendSubTab(webdriver, logger);
const errorMarkIsDisplayed = await sendStep1Page.receiverIsIncorrect();
expect(errorMarkIsDisplayed, 'There is no error for receiver').to.be.true;
});

it(`Check displayed info`, async function () {
const sendStep1Page = new SendSubTab(webdriver, logger);
const helperText = await sendStep1Page.getReceiverHelperText();
expect(helperText, 'A different error message is displayed').to.equal(INVALID_ADDRESS);
const errorMessageIsDisplayed = await sendStep1Page.waitReceiverHelperTextEqual(INVALID_ADDRESS);
expect(errorMessageIsDisplayed, 'A different error message is displayed').to.equal(true);
});

afterEach(function (done) {
Expand Down
Loading

0 comments on commit a741c7d

Please sign in to comment.