-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-price-chart-multiple-labels
- Loading branch information
Showing
77 changed files
with
1,059 additions
and
975 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { LimitOrderLocators } from "../selectors/selectors.cy" | ||
import { TokenCatalog } from "./swap-page.po.cy" | ||
export interface myCallbackType<T> { | ||
(myArgument: T): void | ||
} | ||
export const LimitOder = { | ||
|
||
selectTokenSell(): TokenCatalog { | ||
cy.selectToken(LimitOrderLocators.dropdownTokenSell) | ||
return new TokenCatalog() | ||
}, | ||
selectTokenBuy(): TokenCatalog { | ||
cy.selectToken(LimitOrderLocators.dropdownTokenBuy) | ||
return new TokenCatalog() | ||
}, | ||
|
||
getCurrentTokenSell(text: myCallbackType<string>) { | ||
cy.getContent(LimitOrderLocators.dropdownTokenSell, text) | ||
}, | ||
|
||
getCurrentTokenBuy(text: myCallbackType<string>) { | ||
cy.getContent(LimitOrderLocators.dropdownTokenBuy, text) | ||
}, | ||
|
||
setSellingRate(text: string) { | ||
cy.get(LimitOrderLocators.txtSellingRate).click().type(text) | ||
}, | ||
|
||
getSellingRate() { | ||
return cy.get(LimitOrderLocators.txtSellingRate).invoke('val').then(value => { | ||
return value | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { LimitOder } from "../pages/limit-order.po.cy" | ||
import { SwapPage, TokenCatalog } from "../pages/swap-page.po.cy" | ||
import { DEFAULT_URL, NETWORK, NORESULTS_TEXT, NOTOKENS_TEXT, TAG, TOKEN_SYMBOLS, UNWHITELIST_SYMBOL_TOKENS, UNWHITELIST_TOKENS } from "../selectors/constants.cy" | ||
|
||
const tokenSymbols = TOKEN_SYMBOLS[NETWORK] | ||
|
||
|
||
const tokenCatalog = new TokenCatalog(); | ||
|
||
|
||
describe(`Token Catalog on ${NETWORK}`, { tags: TAG.regression }, () => { | ||
beforeEach(() => { | ||
SwapPage.open(DEFAULT_URL) | ||
SwapPage.goToLimitOrder() | ||
}) | ||
|
||
describe('Add/remove/select token with favorite tokens list', () => { | ||
it('Should be added, selected and removed favorite token sell', () => { | ||
LimitOder.selectTokenSell().addFavoriteToken([tokenSymbols[0], tokenSymbols[4]]) | ||
tokenCatalog.getFavoriteTokens((list) => { | ||
expect(list).to.include.members([tokenSymbols[4]]) | ||
}) | ||
|
||
tokenCatalog.selectFavoriteToken(tokenSymbols[4]) | ||
LimitOder.getCurrentTokenSell((text) => { | ||
expect(text).to.equal(tokenSymbols[4]) | ||
}) | ||
LimitOder.selectTokenSell() | ||
tokenCatalog.removeFavoriteToken(tokenSymbols[0]) | ||
tokenCatalog.getFavoriteTokens((list) => { | ||
expect(list).not.to.include.members([tokenSymbols[0]]) | ||
}) | ||
}) | ||
|
||
it('Should be added, selected and removed favorite token buy', () => { | ||
LimitOder.selectTokenBuy().addFavoriteToken([tokenSymbols[0], tokenSymbols[4]]) | ||
tokenCatalog.getFavoriteTokens((list) => { | ||
expect(list).to.include.members([tokenSymbols[4]]) | ||
}) | ||
|
||
tokenCatalog.selectFavoriteToken(tokenSymbols[4]) | ||
LimitOder.getCurrentTokenBuy((text) => { | ||
expect(text).to.equal(tokenSymbols[4]) | ||
}) | ||
LimitOder.selectTokenBuy() | ||
tokenCatalog.removeFavoriteToken(tokenSymbols[0]) | ||
tokenCatalog.getFavoriteTokens((list) => { | ||
expect(list).not.to.include.members([tokenSymbols[0]]) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Select token by symbol', () => { | ||
it('Should be selected token sell by symbol successfully', () => { | ||
LimitOder.selectTokenSell().selectTokenBySymbol(tokenSymbols[0]) | ||
LimitOder.getCurrentTokenSell((text) => { | ||
expect(text).to.equal(tokenSymbols[0]) | ||
}) | ||
}) | ||
|
||
it('Should be selected token buy by symbol successfully', () => { | ||
LimitOder.selectTokenBuy().selectTokenBySymbol(tokenSymbols[1]) | ||
LimitOder.getCurrentTokenBuy((text) => { | ||
expect(text).to.equal(tokenSymbols[1]) | ||
}) | ||
}) | ||
|
||
it('Should be unselected token sell not exist in whitelist', () => { | ||
LimitOder.selectTokenSell().searchToken(UNWHITELIST_SYMBOL_TOKENS[0]) | ||
tokenCatalog.getNoResultsFound((text) => { | ||
expect(text).to.equal(NORESULTS_TEXT) | ||
}) | ||
}) | ||
|
||
it('Should be unselected token buy not exist in whitelist', () => { | ||
LimitOder.selectTokenBuy().searchToken(UNWHITELIST_SYMBOL_TOKENS[0]) | ||
tokenCatalog.getNoResultsFound((text) => { | ||
expect(text).to.equal(NORESULTS_TEXT) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Sell rate', () => { | ||
it('Able to set selling rate by number', () => { | ||
LimitOder.setSellingRate('1.2345..67') | ||
LimitOder.getSellingRate().then((value) => { | ||
cy.wrap(value).should('eq', '1.234567') | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.