Skip to content

Commit 8dfe42a

Browse files
HusneShabbirHusneShabbir
andauthored
test(quickstart): cover Set up Lightspeed step in guest admin e2e (#2938)
Expand setupLightspeed, assert description CTA opens RHDH Lightspeed docs URL, and run before navigating to extensions so the drawer is still open. Made-with: Cursor Co-authored-by: HusneShabbir <husneshabbir447@gmail.com>
1 parent cb70fc5 commit 8dfe42a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

workspaces/quickstart/e2e-tests/quick-start-admin-guest.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,43 @@ test.describe('Test Quick Start plugin', () => {
110110
expect(href).toContain(
111111
'https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/integrating_red_hat_developer_hub_with_github/',
112112
);
113+
114+
const lightspeedDocsUrl =
115+
'https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/interacting_with_red_hat_developer_lightspeed_for_red_hat_developer_hub/';
116+
117+
const setupLightspeedStepTitle = page.getByText(
118+
translations.steps.setupLightspeed.title,
119+
);
120+
await setupLightspeedStepTitle.click();
121+
const setupLightspeedDescription = page.getByText(
122+
translations.steps.setupLightspeed.description,
123+
);
124+
await setupLightspeedDescription.waitFor({ state: 'visible' });
125+
await expect(page.getByRole('list')).toContainText(
126+
translations.steps.setupLightspeed.description,
127+
);
128+
const setupLightspeedParentList = setupLightspeedDescription
129+
.locator('..')
130+
.locator('..')
131+
.locator('..');
132+
const setupLightspeedCta = setupLightspeedParentList
133+
.getByRole('button', {
134+
name: translations.steps.setupLightspeed.ctaTitle,
135+
})
136+
.first();
137+
await setupLightspeedCta.waitFor({ state: 'visible' });
138+
expect(await setupLightspeedCta.getAttribute('href')).toContain(
139+
lightspeedDocsUrl,
140+
);
141+
113142
await page.getByText(translations.steps.managePlugins.title).click();
114143
await uiHelper.verifyButtonURL(
115144
translations.steps.managePlugins.ctaTitle,
116145
'/extensions',
117146
);
118147
await uiHelper.clickButtonByText(translations.steps.managePlugins.ctaTitle);
119148
await expect(page).toHaveURL(/extensions/);
149+
120150
const progressPattern = new RegExp(
121151
translations.footer.progress.replace('{{progress}}', '\\d+'),
122152
);

0 commit comments

Comments
 (0)