-
Notifications
You must be signed in to change notification settings - Fork 5k
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
test: [POM] Migrate token tests #29375
base: main
Are you sure you want to change the base?
Changes from all commits
c5367d0
6e9112d
20ba9c4
352dd40
886cf1a
874c128
d00f8e3
5aa73cf
bab4345
073579f
b4d3fec
e8fbb7a
f11c25d
be104ee
faffc73
f8a0e0e
10f2f7a
37cbee3
7f54477
3c2f970
b0febde
86ae434
8ea7007
6be682d
a8ab1ad
c166dff
c09fd7d
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Driver } from '../../webdriver/driver'; | ||
|
||
class TokenOverviewPage { | ||
private driver: Driver; | ||
|
||
private readonly receiveButton = { | ||
text: 'Receive', | ||
css: '.icon-button', | ||
}; | ||
|
||
private readonly sendButton = { | ||
text: 'Send', | ||
css: '.icon-button', | ||
}; | ||
|
||
private readonly swapButton = { | ||
text: 'Swap', | ||
css: '.icon-button', | ||
}; | ||
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. Using text based selectors here, it's more accessible and means we don't have to create multiple selectors depending on the type of token screen we are looking at. i.e Is the token enabled for swap, bridge, send etc. The other selector would be either |
||
|
||
constructor(driver: Driver) { | ||
this.driver = driver; | ||
} | ||
|
||
async check_pageIsLoaded(): Promise<void> { | ||
try { | ||
await this.driver.waitForMultipleSelectors([ | ||
this.sendButton, | ||
this.swapButton, | ||
]); | ||
} catch (e) { | ||
console.log( | ||
'Timeout while waiting for Token overview page to be loaded', | ||
e, | ||
); | ||
throw e; | ||
} | ||
console.log('Token overview page is loaded'); | ||
} | ||
|
||
async clickReceive(): Promise<void> { | ||
await this.driver.clickElement(this.receiveButton); | ||
} | ||
|
||
async clickSend(): Promise<void> { | ||
await this.driver.clickElement(this.sendButton); | ||
} | ||
|
||
async clickSwap(): Promise<void> { | ||
await this.driver.clickElement(this.swapButton); | ||
} | ||
} | ||
|
||
export default TokenOverviewPage; |
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.
A couple of small things:
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.
Yes, I also had the same thought. It could make sense (if we keep it text based as I have done here)
the only doubt that I have is the depending on the token type different buttons are displayed so that is still something to think about. I do agree though there is a way we could make this easier to deal with