Skip to content

Commit

Permalink
test(e2e): wait for sidebar to appear
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 b0e7977 commit d1ea633
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/e2e/helpers/assertions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { browser } from '@wdio/globals'
import type { Workbench } from 'wdio-vscode-service'
import type { ViewContent, Workbench } from 'wdio-vscode-service'

/**
* Asserts that the CLI Commands and Patches sections are visible in the sidebar. This is
* considered the default state when the workspace is open with a git and rad initialized
* repository.
*/
export async function expectCliCommandsAndPatchesToBeVisible(workbench: Workbench) {
const sidebarView = workbench.getSideBar().getContent()
await sidebarView.wait()
let sidebarView: ViewContent

await browser.waitUntil(async () => {
try {
sidebarView = workbench.getSideBar().getContent()
await sidebarView.wait()
// eslint-disable-next-line prettier-vue/prettier
} catch { }

return Boolean(sidebarView)
})

await browser.waitUntil(
async () => {
Expand Down

0 comments on commit d1ea633

Please sign in to comment.