Skip to content

Commit

Permalink
test(e2e): move assertion helper inside spec file
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 28, 2024
1 parent e9731d2 commit 10175c7
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/e2e/specs/onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { Workbench } from 'wdio-vscode-service'
import { $, cd } from 'zx'
import type * as VsCode from 'vscode'
import isEqual from 'lodash/isEqual'
import { expectCliCommandsAndPatchesToBeVisible } from '../helpers/assertions'
import { openRadicleViewContainer } from '../helpers/actions'
import { getFirstWelcomeViewText } from '../helpers/queries'

Expand Down Expand Up @@ -163,3 +162,20 @@ async function getFirstWelcomeViewButtonTitles(workbench: Workbench) {

return buttonTitles
}

async function expectCliCommandsAndPatchesToBeVisible(workbench: Workbench) {
const sidebarView = workbench.getSideBar().getContent()
await sidebarView.wait()

await browser.waitUntil(async () => {
let sectionsFound = false
try {
await sidebarView.getSection('CLI COMMANDS')
await sidebarView.getSection('PATCHES')
sectionsFound = true
// eslint-disable-next-line prettier-vue/prettier
} catch { }

return sectionsFound
})
}

0 comments on commit 10175c7

Please sign in to comment.