Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

e2e - Add search token by name and select input #1918

Closed
wants to merge 2 commits into from

Conversation

MareenG
Copy link

@MareenG MareenG commented Nov 25, 2021

Summary

Add search token by name and select input to e2e swap.tests. Related to #1870

Allows to search tokens by names. In this case it selects DAI as a buy token.

To Test

  1. See if tests are passing

Not included

Make token name input parameterized.By doing this we could insert any token name from a specific token list and more token pairs can be tested.

Add search token by name and select input to swap.test
@MareenG MareenG added the app:CowSwap CowSwap app label Nov 25, 2021
@MareenG MareenG requested a review from a team November 25, 2021 11:14
@MareenG MareenG removed the app:CowSwap CowSwap app label Nov 25, 2021
change cy.visit('https://cowswap.exchange') to  cy.visit('/swap')
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

// search by name and select input
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.get('#token-search-input').click().type('DAI')
cy.get('.sc-pg5r79-2.cUmBvs > div > div').contains('DAI').click({ force: true })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it'll work because the class name you are depending on will probably change at every build

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One Ideas was to add an ID to the currency list as done in #1922. This way it should not change. Would this solve your concerns or are there additional things?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! That was made exactly for this, I believe :)

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to create a command like that we could use like cy.selectInputBySymbol('DAI') and would automate the search of DAI and select the first result

We have a similar non-working command here

function selectInput(tokenAddress) {
that would be also nice to fix.

@MareenG
Copy link
Author

MareenG commented Nov 26, 2021

The idea was to create a command like that we could use like cy.selectInputBySymbol('DAI') and would automate the search of DAI and select the first result

I am not sure If I get it. I should make it into a cy command?

@anxolin
Copy link
Contributor

anxolin commented Nov 26, 2021

I mean https://docs.cypress.io/api/cypress-api/custom-commands

I was pointing you to a super similar command in my comment

@W3stside
Copy link
Contributor

closing

@W3stside W3stside closed this Jan 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants