-
Notifications
You must be signed in to change notification settings - Fork 20
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
Various UI and test fixes #528
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { notifications } from '../support/page-objects/notifications' | |
import { topMenuItems } from '../support/page-objects/topMenuItems' | ||
import { landingPage } from '../support/page-objects/landingPage' | ||
import { waitForTxRequest } from '../utils/waitForTxRequests' | ||
import { waitForMultisigLength } from '../utils/waitForMultisigLength' | ||
|
||
const fundedAccount1 = testAccounts['Funded Account 1 Chopsticks Kusama'] | ||
const fundedAccount2 = testAccounts['Funded Account 2 Chopsticks Kusama'] | ||
|
@@ -23,7 +24,7 @@ const typeAndAdd = (address: string) => { | |
newMultisigPage.addButton().click() | ||
} | ||
|
||
const acceptMultisigCreationAndVerifyNotifications = () => { | ||
const acceptMultisigCreationAndVerifyNotifications = (firstMultisig = false) => { | ||
waitForTxRequest() | ||
cy.getTxRequests().then((req) => { | ||
const txRequests = Object.values(req) | ||
|
@@ -36,6 +37,8 @@ const acceptMultisigCreationAndVerifyNotifications = () => { | |
notifications.loadingNotificationIcon().should('be.visible') | ||
notifications.notificationWrapper().should('contain', 'broadcast') | ||
|
||
firstMultisig && landingPage.firstMultisigCreationLabel().should('be.visible') | ||
|
||
notifications.successNotificationIcon(30000).should('be.visible') | ||
notifications.notificationWrapper().should('contain', 'Tx in block') | ||
}) | ||
|
@@ -102,9 +105,7 @@ describe('Multisig creation', () => { | |
newMultisigPage.step3.infoBox().should('contain', '1 batch transaction') | ||
newMultisigPage.step3.errorNotEnoughFunds().should('not.exist') | ||
newMultisigPage.nextButton().should('contain', 'Create').click() | ||
acceptMultisigCreationAndVerifyNotifications() | ||
|
||
landingPage.firstMultisigCreationLabel().should('be.visible') | ||
acceptMultisigCreationAndVerifyNotifications(true) | ||
|
||
// Landing Page | ||
multisigPage.accountHeader(10000).within(() => { | ||
|
@@ -144,14 +145,12 @@ describe('Multisig creation', () => { | |
|
||
// The banner should be there, and disapear within 30s | ||
landingPage.multisigCreationInfoBanner().should('be.visible') | ||
landingPage.creationInfoBannerCloseButton().click() | ||
|
||
cy.clock().then((clock) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this wasn't working. Adding the cy.clock before the cy.visit actually breaks everything, somehow, as the api calls don't get fired. All in all removing the clock |
||
// The banner should disapear after 30s, speed it up by 15s | ||
clock.tick(15000) | ||
// The banner should disappear | ||
landingPage.multisigCreationInfoBanner(30000).should('not.exist') | ||
clock.restore() | ||
}) | ||
// The banner should disappear | ||
landingPage.multisigCreationInfoBanner().should('not.exist') | ||
|
||
waitForMultisigLength(2) | ||
|
||
topMenuItems | ||
.desktopMenu() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { multisigPage } from '../support/page-objects/multisigPage' | ||
import { topMenuItems } from '../support/page-objects/topMenuItems' | ||
|
||
export const waitForMultisigLength = (length: number) => | ||
cy.waitUntil(() => { | ||
multisigPage.accountHeader().click() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is doing a click outside basically, so that if any dropdown is open, it's close it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, might be worth adding a small comment there about that so we remember why we are doing that. |
||
return topMenuItems | ||
.multiproxySelectorDesktop() | ||
.click() | ||
.then(() => { | ||
return topMenuItems.multiproxySelectorOptionDesktop().then((el) => el.length === length) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asnaith this actually made it so that it'd have failed earlier, I tested by removing my fix. It's better than having to wait 2s on purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep makes sense :)