Skip to content

Commit

Permalink
Th/update/e2e wdio (#195)
Browse files Browse the repository at this point in the history
* fix init transaction function
  • Loading branch information
tudorgabriel committed Mar 27, 2024
1 parent 93b8c3b commit 57d09a5
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 660 deletions.
20 changes: 15 additions & 5 deletions wdio/test/specs/KeystoreScreen/Keystore.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,31 @@ describe('Sign with Keystore', () => {
await validateTransaction(TransactionIndexEnum.signBatch);
});

it('should close the wallet',async () => {
it('should close the wallet', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await $(GlobalSelectorEnum.batchBtn).click();
await browser.pause(500)
await browser.pause(2500);
await browser.switchWindow(GlobalDataEnum.walletWindow);
for(let i=0; i<3;i++) {
for (let i = 0; i < 3; i++) {
await $(GlobalSelectorEnum.accesPass).setValue(`invalid+${i}`);
await $(GlobalSelectorEnum.accesWalletBtn).click();
await browser.pause(2000)
await browser.pause(2000);
}
await checkOpenTabs()
await checkOpenTabs();
});

it('should sign transaction with PEM', async () => {
const loginData = {
selector: GlobalSelectorEnum.pemBtn,
file: GlobalDataEnum.invalidPem,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.abiType);
});
});
1 change: 0 additions & 1 deletion wdio/test/specs/LedgerScreen/LedgerSpec.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('Check Ledger Modal', () => {
route: RoutesEnum.ledger
};
await openProviderModal(providerData);
await browser.pause(5000);
});
it('should properly open the ledger modal from dApp tab', async () => {
await $(GlobalSelectorEnum.ledgerBtn).click();
Expand Down
5 changes: 0 additions & 5 deletions wdio/test/specs/PemScreen/PemSpec.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('Sign transactions with PEM', () => {

it('should close the wallet window', async () => {
await closeWalletTab();
await browser.pause(60000);
});

it('should close the wallet window after refresh', async () => {
Expand All @@ -55,10 +54,6 @@ describe('Sign transactions with PEM', () => {
await notConfirmPem();
});

it('should sign transaction with PEM', async () => {
await pingPongHandler(GlobalSelectorEnum.abiType);
});

it('should sign msg with PEM', async () => {
await signMsg();
});
Expand Down
17 changes: 9 additions & 8 deletions wdio/test/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export async function login(payload: {
const wallet = await $(`[data-testid*=${payload.adress}]`);

await $(GlobalSelectorEnum.crossWindowLoginBtn).click();
await browser.pause(1500);
await browser.pause(4500);
await browser.switchWindow(GlobalDataEnum.walletWindow);
await $(payload.selector).click();
await browser.pause(1500);
await browser.pause(2500);
await uploadFile(payload.file);
if (payload.selector === GlobalSelectorEnum.keystoreBtn) {
await confirmPass();
Expand Down Expand Up @@ -92,7 +92,7 @@ export async function openProviderModal(payload: {
route: string;
}) {
await $(GlobalSelectorEnum.crossWindowLoginBtn).click();
await browser.pause(2500);
await browser.pause(3500);
await browser.switchWindow(GlobalDataEnum.walletWindow);
await $(payload.selector).click();
await browser.pause(1000);
Expand All @@ -117,7 +117,7 @@ export async function validateTransaction(svgIndex: number) {
await svgElement[svgIndex].click();
await browser.switchWindow(GlobalDataEnum.explorerWindow);
const succesMsg = await $('span*=Succes');
await succesMsg.waitForDisplayed({ timeout: 60000 });
await succesMsg.waitForDisplayed({ timeout: 85000 });
}

export const checkWidgetMsg = async (msgArr: string[]) => {
Expand Down Expand Up @@ -153,11 +153,12 @@ export const scTransaction = async (type: string) => {
await browser.pause(3000);
await browser.switchWindow(GlobalDataEnum.walletWindow);
if (!(await $(GlobalSelectorEnum.accesPass).isDisplayed())) {
await confimPem(GlobalDataEnum.pemFile);
await $(GlobalSelectorEnum.accesWalletBtn).click();
await confimPem(GlobalDataEnum.invalidPem);
await $(GlobalSelectorEnum.signBtn).click();
} else {
await confirmPass();
await $(GlobalSelectorEnum.signBtn).click();
}
await confirmPass();
await $(GlobalSelectorEnum.signBtn).click();
await browser.pause(1500);
await browser.switchWindow(GlobalDataEnum.daapWindow);
await validateToast(GlobalSelectorEnum.toastSelector);
Expand Down
17 changes: 10 additions & 7 deletions wdio/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ export const config: Options.Testrunner = {

specs: ['./test/specs/**/*.ts'],
suites: {
smoke: ['./test/specs/PemScreen/PemSpec.e2e.ts']
smoke: [
// './test/specs/PemScreen/PemSpec.e2e.ts'
'./test/specs/KeystoreScreen/Keystore.e2e.ts'
]
},
// Patterns to exclude.
exclude: [],

maxInstances: 5,
maxInstances: 4,
specFileRetries: 1,
specFileRetriesDeferred: true,

Expand All @@ -30,15 +33,15 @@ export const config: Options.Testrunner = {
args: [
'--disable-infobars',
'--start-maximized',
'--no-sandbox',
'--headless=new'
'--no-sandbox'
// '--headless=new'
]
},
acceptInsecureCerts: true
},
{
browserName: 'safari'
}
// {
// browserName: 'firefox'
// }
],

logLevel: 'error',
Expand Down
Loading

0 comments on commit 57d09a5

Please sign in to comment.