Skip to content

Commit

Permalink
Fixing e2e tests and updating snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
VSaric committed Jan 19, 2023
1 parent 6062686 commit b84b9ae
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 27 deletions.
38 changes: 11 additions & 27 deletions test/e2e/tests/navigate-transactions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,69 +28,55 @@ describe('Navigate transactions', function () {

// navigate transactions
await driver.clickElement('[data-testid="next-page"]');
let navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
let navigationElement = await driver.findElement('.navigation');
let navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('2 of 4'),
true,
'changed transaction right',
);
await driver.clickElement('[data-testid="next-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('3 of 4'),
true,
'changed transaction right',
);
await driver.clickElement('[data-testid="next-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('4 of 4'),
true,
'changed transaction right',
);
await driver.clickElement('[data-testid="first-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('1 of 4'),
true,
'navigate to first transaction',
);
await driver.clickElement('[data-testid="last-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('4 of 4'),
true,
'navigate to last transaction',
);
await driver.clickElement('[data-testid="previous-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('3 of 4'),
true,
'changed transaction left',
);
await driver.clickElement('[data-testid="previous-page"]');
navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
navigationElement = await driver.findElement('.navigation');
navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('2 of 4'),
Expand Down Expand Up @@ -118,9 +104,7 @@ describe('Navigate transactions', function () {
await driver.press('#password', driver.Key.ENTER);

await driver.clickElement('[data-testid="next-page"]');
let navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
);
let navigationElement = await driver.findElement('.navigation');
let navigationText = await navigationElement.getText();
assert.equal(
navigationText.includes('2 of 4'),
Expand All @@ -137,7 +121,7 @@ describe('Navigate transactions', function () {
await driver.switchToWindow(extension);
navigationElement = await driver.waitForSelector(
{
css: '.confirm-page-container-navigation',
css: '.navigation',
text: '2 of 5',
},
{ timeout: 10000 },
Expand Down Expand Up @@ -170,7 +154,7 @@ describe('Navigate transactions', function () {
await driver.clickElement({ text: 'Reject', tag: 'button' });
const navigationElement = await driver.waitForSelector(
{
css: '.confirm-page-container-navigation',
css: '.navigation',
text: '1 of 3',
},
{ timeout: 10000 },
Expand Down Expand Up @@ -203,7 +187,7 @@ describe('Navigate transactions', function () {
await driver.clickElement({ text: 'Confirm', tag: 'button' });
const navigationElement = await driver.waitForSelector(
{
css: '.confirm-page-container-navigation',
css: '.navigation',
text: '1 of 3',
},
{ timeout: 10000 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,72 @@ exports[`Signature Request Component render should match snapshot 1`] = `
<div
class="signature-request"
>
<div
class="navigation"
style="display: none;"
>
<div
class="navigation__container"
data-testid="navigation-container"
style="visibility: hidden;"
>
<button
class="navigation__arrow"
data-testid="first-page"
>
<i
class="fa fa-angle-double-left fa-2x"
/>
</button>
<button
class="navigation__arrow"
data-testid="previous-page"
>
<i
class="fa fa-angle-left fa-2x"
/>
</button>
</div>
<div
class="navigation__textcontainer"
>
<div
class="navigation__navtext"
>
0
of
0
</div>
<div
class="navigation__longtext"
>
requests waiting to be acknowledged
</div>
</div>
<div
class="navigation__container"
style="visibility: hidden;"
>
<button
class="navigation__arrow"
data-testid="next-page"
>
<i
class="fa fa-angle-right fa-2x"
/>
</button>
<button
class="navigation__arrow"
data-testid="last-page"
>
<i
class="fa fa-angle-double-right fa-2x"
/>
</button>
</div>
</div>
<div
class="request-signature__account"
>
Expand Down

0 comments on commit b84b9ae

Please sign in to comment.