-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from cytechmobile/feat/onboarding-e2e-tests
test(e2e): onboarding tests
- Loading branch information
Showing
6 changed files
with
170 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Workbench } from 'wdio-vscode-service' | ||
|
||
/** | ||
* Opens the Radicle view container in the sidebar, by clicking the radicle button in the | ||
* activity bar. | ||
*/ | ||
export async function openRadicleViewContainer(workbench: Workbench) { | ||
const activityBar = workbench.getActivityBar() | ||
await activityBar.wait() | ||
|
||
const radicleViewControl = await activityBar.getViewControl('Radicle') | ||
await radicleViewControl?.wait() | ||
|
||
await radicleViewControl?.openView() | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { browser } from '@wdio/globals' | ||
import type { 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 expectStandardSidebarViewsToBeVisible(workbench: Workbench) { | ||
const sidebarView = workbench.getSideBar().getContent() | ||
await sidebarView.wait() | ||
|
||
await browser.waitUntil( | ||
async () => { | ||
try { | ||
await Promise.all([ | ||
sidebarView.getSection('CLI COMMANDS'), | ||
sidebarView.getSection('PATCHES'), | ||
]) | ||
|
||
return true | ||
} catch { | ||
return false | ||
} | ||
}, | ||
{ timeoutMsg: 'expected the standard sidebar views to be visible' }, | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { Workbench } from 'wdio-vscode-service' | ||
|
||
/** | ||
* Retrieves the welcome text content from the first section in the sidebar view. | ||
* | ||
* @example await getFirstWelcomeViewText(workbench) // ["Welcome to Radicle!", "Get started by ..."] | ||
* | ||
* @returns The text content found as an array of strings split by newlines. If no content is | ||
* found, an empty array. | ||
*/ | ||
export async function getFirstWelcomeViewText(workbench: Workbench) { | ||
const sidebarView = workbench.getSideBar().getContent() | ||
await sidebarView.wait() | ||
|
||
const welcomeText = | ||
(await ( | ||
await (await sidebarView.getSections())[0]?.findWelcomeContent() | ||
)?.getTextSections()) ?? [] | ||
|
||
return welcomeText | ||
} |
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