Skip to content

Commit 841e396

Browse files
committed
test: e2e de-flaking when commands aren't ready
1 parent 7204170 commit 841e396

6 files changed

Lines changed: 12 additions & 0 deletions

File tree

packages/salesforcedx-vscode-core/test/playwright/specs/analyticsTemplates.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
setupNetworkMonitoring,
1313
waitForVSCodeWorkbench,
1414
waitForWorkspaceReady,
15+
verifyCommandExists,
1516
closeWelcomeTabs,
1617
executeCommandWithCommandPalette,
1718
validateNoCriticalErrors,
@@ -37,6 +38,7 @@ test.describe('Analytics Templates (Desktop Only)', () => {
3738
test('Create Sample Analytics Template', async ({ page }) => {
3839
const name = `Analytics${Date.now()}`;
3940
await test.step(`Create Analytics Template ${name}`, async () => {
41+
await verifyCommandExists(page, packageNls.analytics_generate_template_text, 30_000);
4042
await executeCommandWithCommandPalette(page, packageNls.analytics_generate_template_text);
4143

4244
const quickInput = page.locator(QUICK_INPUT_WIDGET);

packages/salesforcedx-vscode-core/test/playwright/specs/auraTemplates.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
setupNetworkMonitoring,
1313
waitForVSCodeWorkbench,
1414
waitForWorkspaceReady,
15+
verifyCommandExists,
1516
closeWelcomeTabs,
1617
executeCommandWithCommandPalette,
1718
validateNoCriticalErrors,
@@ -37,6 +38,7 @@ test.describe('Aura Templates (Desktop Only)', () => {
3738

3839
const createAuraTemplate = async (page: any, command: string, name: string, expectedFiles: string[]) => {
3940
await test.step(`Create Aura ${name}`, async () => {
41+
await verifyCommandExists(page, command, 30_000);
4042
await executeCommandWithCommandPalette(page, command);
4143

4244
const quickInput = page.locator(QUICK_INPUT_WIDGET);

packages/salesforcedx-vscode-core/test/playwright/specs/manifestBuilder.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
setupConsoleMonitoring,
1313
openFileByName,
1414
executeCommandWithCommandPalette,
15+
verifyCommandExists,
1516
executeExplorerContextMenuCommand,
1617
clearOutputChannel,
1718
waitForOutputChannelText,
@@ -76,6 +77,7 @@ test('Manifest Builder: generate manifest, deploy and retrieve via manifest', as
7677
await openFileByName(page, 'package.xml');
7778
await clearOutputChannel(page);
7879

80+
await verifyCommandExists(page, packageNls.deploy_in_manifest_text, 120_000);
7981
await executeCommandWithCommandPalette(page, packageNls.deploy_in_manifest_text);
8082
await waitForOutputChannelText(page, {
8183
expectedText: 'Deployed Source',

packages/salesforcedx-vscode-core/test/playwright/specs/metadataDeployRetrieve.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
editOpenFile,
1313
openFileByName,
1414
executeCommandWithCommandPalette,
15+
verifyCommandExists,
1516
clearOutputChannel,
1617
waitForOutputChannelText,
1718
validateNoCriticalErrors,
@@ -50,6 +51,7 @@ test('Metadata Deploy Retrieve: deploy v1, deploy v2, retrieve matches v2', asyn
5051

5152
await clearOutputChannel(page);
5253
await openFileByName(page, `${className}.cls`);
54+
await verifyCommandExists(page, packageNls.deploy_this_source_text, 120_000);
5355
await executeCommandWithCommandPalette(page, packageNls.deploy_this_source_text);
5456
await waitForOutputChannelText(page, {
5557
expectedText: `Ended ${packageNls.deploy_this_source_text}`,

packages/salesforcedx-vscode-core/test/playwright/specs/pushAndPull.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
setupConsoleMonitoring,
1111
editOpenFile,
1212
executeCommandWithCommandPalette,
13+
verifyCommandExists,
1314
clearOutputChannel,
1415
waitForOutputChannelText,
1516
validateNoCriticalErrors,
@@ -33,6 +34,7 @@ test('Push and Pull: push, pull, and view changes', async ({ page }) => {
3334

3435
await test.step('view all changes (empty)', async () => {
3536
await clearOutputChannel(page);
37+
await verifyCommandExists(page, packageNls.view_all_changes_text, 120_000);
3638
await executeCommandWithCommandPalette(page, packageNls.view_all_changes_text);
3739
await waitForOutputChannelText(page, {
3840
expectedText: SOURCE_STATUS_HEADER,

packages/salesforcedx-vscode-core/test/playwright/specs/visualforceTemplates.headless.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
setupNetworkMonitoring,
1313
waitForVSCodeWorkbench,
1414
waitForWorkspaceReady,
15+
verifyCommandExists,
1516
closeWelcomeTabs,
1617
executeCommandWithCommandPalette,
1718
validateNoCriticalErrors,
@@ -37,6 +38,7 @@ test.describe('Visualforce Templates (Desktop Only)', () => {
3738

3839
const createVisualforceTemplate = async (page: any, command: string, name: string, expectedFiles: string[]) => {
3940
await test.step(`Create Visualforce ${name}`, async () => {
41+
await verifyCommandExists(page, command, 30_000);
4042
await executeCommandWithCommandPalette(page, command);
4143

4244
const quickInput = page.locator(QUICK_INPUT_WIDGET);

0 commit comments

Comments
 (0)