Skip to content

Commit

Permalink
test(e2e): clear settings searchbox after first describe
Browse files Browse the repository at this point in the history
Signed-off-by: Zacharias Fragkiadakis <zacfragkiadakis@gmail.com>
  • Loading branch information
QZera committed Dec 31, 2024
1 parent 1c4e700 commit 7291915
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test/e2e/specs/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ describe('Settings', () => {
)
})

after(async () => {
const searchBox = await getSettingsSearchBox(settings)
await clearInput(searchBox)

expect(searchBox.getValue()).toBe('')
})

afterEach(async () => {
await clearTextSetting(pathToRadBinarySetting)

Expand Down Expand Up @@ -83,11 +90,6 @@ describe('Settings', () => {

describe('VS Code, when updating the "Path to Radicle to Node Home" setting,', () => {
it('displays error in output console', async () => {
// Close and re-open the settings editor (to clear the input)
await browser.keys([Key.Ctrl, 'w'])
await browser.pause(1000) // TODO: zac check if this is necessary
settings = await workbench.openSettings()

await workbench.executeCommand('Show Everything Logged in the Output Panel')
const outputView = await workbench.getBottomBar().openOutputView()
await outputView.clearText()
Expand Down Expand Up @@ -172,3 +174,13 @@ async function clearTextSetting(setting: Setting) {
await browser.keys([Key.Ctrl, 'a'])
await browser.keys(Key.Backspace)
}

async function getSettingsSearchBox(settings: SettingsEditor) {
return await settings.elem.$(settings.locatorMap.Editor['inputArea'] as string)
}

async function clearInput(input: WebdriverIO.Element) {
await input.setValue('')
await browser.keys([Key.Ctrl, 'a'])
await browser.keys(Key.Backspace)
}

0 comments on commit 7291915

Please sign in to comment.