-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
260 additions
and
675 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
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 |
---|---|---|
@@ -1,59 +1,64 @@ | ||
import { LimitOrderLocators } from "../selectors/selectors.cy" | ||
import { TokenCatalog } from "./swap-page.po.cy" | ||
import { LimitOrderLocators } from '../selectors/selectors.cy' | ||
import { TokenCatalog } from './swap-page.po.cy' | ||
|
||
export interface myCallbackType<T> { | ||
(myArgument: T): void | ||
(myArgument: T): void | ||
} | ||
export const LimitOder = { | ||
checkGetStartedDisplay() { | ||
return cy | ||
.get(LimitOrderLocators.btnGetStarted, { timeout: 10000 }) | ||
.should(() => {}) | ||
.then($obj => $obj.length > 0) | ||
}, | ||
|
||
clickGetStarted() { | ||
cy.get(LimitOrderLocators.btnGetStarted, { timeout: 10000 }).click({ force: true }) | ||
}, | ||
|
||
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) | ||
}, | ||
|
||
setSellAmount(value: string) { | ||
cy.get(LimitOrderLocators.txtTokenSellAmount).type(value) | ||
}, | ||
|
||
setSellingRate(text: string) { | ||
cy.get(LimitOrderLocators.txtSellingRate).click().type(text) | ||
}, | ||
|
||
getSellingRate() { | ||
return cy.get(LimitOrderLocators.txtSellingRate).invoke('val') | ||
}, | ||
|
||
getBalanceIn(text: myCallbackType<string>) { | ||
cy.getContent(LimitOrderLocators.lblBalanceIn, text) | ||
}, | ||
getSellAmount() { | ||
return cy.get(LimitOrderLocators.txtTokenSellAmount).invoke('val') | ||
}, | ||
|
||
checkGetStartedDisplay() { | ||
return cy.get(LimitOrderLocators.btnGetStarted, { timeout: 10000 }).should(() => { }).then($obj => { | ||
if ($obj.length > 0) { | ||
return true | ||
} | ||
return false | ||
}) | ||
}, | ||
|
||
clickGetStarted() { | ||
cy.get(LimitOrderLocators.btnGetStarted, { timeout: 10000 }).click({ force: true }) | ||
}, | ||
|
||
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) | ||
}, | ||
|
||
setAmountIn(value: string) { | ||
cy.get(LimitOrderLocators.txtTokenSellAmount).type(value) | ||
}, | ||
|
||
setSellingRate(text: string) { | ||
cy.get(LimitOrderLocators.txtSellingRate).click().type(text) | ||
}, | ||
|
||
getSellingRate() { | ||
return cy.get(LimitOrderLocators.txtSellingRate).invoke('val').then(value => { | ||
return value | ||
}) | ||
}, | ||
|
||
getBalanceIn(text: myCallbackType<string>) { | ||
cy.getContent(LimitOrderLocators.lblBalanceIn, text) | ||
}, | ||
|
||
getInsufficientErrorMessage() { | ||
return cy.get(LimitOrderLocators.lblErrorMessage) | ||
} | ||
getInsufficientErrorMessage() { | ||
return cy.get(LimitOrderLocators.lblErrorMessage) | ||
}, | ||
setBuyAmount(amount: string) { | ||
cy.get('#create-limit-order-input-tokenb input').click().type(amount) | ||
}, | ||
getBuyAmount() { | ||
return cy.get('#create-limit-order-input-tokenb input').invoke('val') | ||
}, | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.