Skip to content
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

QA New Test Balance after hiding and showing token #2062

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eunjisong
Copy link
Contributor

@eunjisong eunjisong commented Nov 7, 2024

Description

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have added/updated necessary unit tests
  • I have updated the documentation

eunjisong and others added 2 commits November 7, 2024 10:20
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Eunji Song <32075932+eunjisong@users.noreply.github.com>
@eunjisong eunjisong marked this pull request as ready for review November 7, 2024 15:37
Comment on lines +42 to +70
async hideToken(token: string) {
await commonElsPage.typeSearchBar(token)
// TryCatch Phrase is for test requirment
try {
await Action.waitForElement(by.id(`${token}_blocked`))
await Action.tap(by.id(`${token}_blocked`))
console.log("Display the token if it's already hidden")
} catch (e) {
console.log("It's already displayed on token list")
}
// Hide the token
await Action.tap(by.id(`${token}_displayed`))
await commonElsPage.goBack()
}

async showToken(token: string) {
await commonElsPage.typeSearchBar(token)
// TryCatch Phrase is for test requirment
try {
await Action.waitForElement(by.id(`${token}_display`))
await Action.tap(by.id(`${token}_blocked`))
console.log("Block the token if it's already displayed")
} catch (e) {
console.log("It's already blocked")
}
// Display the token
await Action.tap(by.id(`${token}_blocked`))
await commonElsPage.goBack()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These methods are almost the same and should be combined into one. Something like this?

async showToken(token: string, tokenStatus: "blocked") {
    await commonElsPage.typeSearchBar(token)
    // TryCatch Phrase is for test requirement
    try {
      await Action.waitForElement(by.id(`${token}_${tokenStatus}`))
      await Action.tap(by.id(`${token}_${tokenStatus}`))
      console.log("Block the token if it's already displayed")
    } catch (e) {
      console.log("It's already blocked")
    }
    // Display the token
    await Action.tap(by.id(`${token}_${tokenStatus}`))
    await commonElsPage.goBack()
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants