Skip to content

Commit 9eb5ba3

Browse files
test(e2e): add test ids and steps of create satellite wizard (#2757)
* test(e2e): add test ids and steps of create satellite wizard * chore: fmt
1 parent dfc93b3 commit 9eb5ba3

5 files changed

Lines changed: 23 additions & 4 deletions

File tree

src/e2e/page-objects/console.page.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,25 @@ export class ConsolePage {
4444

4545
await this.#page.getByTestId(testIds.launchpad.launch).click();
4646

47-
await expect(this.#page.getByTestId(testIds.createSatellite.create)).toBeVisible();
47+
// Initial step
48+
await expect(this.#page.getByTestId(testIds.createSatellite.continueToMetadata)).toBeVisible();
49+
50+
await this.#page.getByTestId(testIds.createSatellite.continueToMetadata).click();
51+
52+
// Metadata step
53+
await expect(this.#page.getByTestId(testIds.createSatellite.continueToOptions)).toBeVisible();
4854

4955
await this.#page.getByTestId(testIds.createSatellite.input).fill('Test');
56+
await this.#page.getByTestId(testIds.createSatellite.continueToOptions).click();
57+
58+
// Options step
59+
await expect(this.#page.getByTestId(testIds.createSatellite.continueToReview)).toBeVisible();
60+
5061
await this.#page.getByTestId(testIds.createSatellite[kind]).click();
62+
await this.#page.getByTestId(testIds.createSatellite.continueToReview).click();
63+
64+
// Review step
65+
await expect(this.#page.getByTestId(testIds.createSatellite.create)).toBeVisible();
5166

5267
await this.#page.getByTestId(testIds.createSatellite.create).click();
5368

src/frontend/src/lib/components/modals/factory/create/SatelliteCreateModal.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import type { FactoryCreateProgress } from '$lib/types/progress-factory-create';
2323
import type { SatelliteId } from '$lib/types/satellite';
2424
import { navigateToSatellite } from '$lib/utils/nav.utils';
25+
import { testId } from '$lib/utils/test.utils';
2526
2627
interface Props {
2728
detail: JunoModalDetail;
@@ -171,7 +172,7 @@
171172
{/snippet}
172173

173174
<button onclick={onclose}>{$i18n.core.cancel}</button>
174-
<button onclick={oncontinue}
175+
<button onclick={oncontinue} {...testId(testIds.createSatellite.continueToMetadata)}
175176
>{nonNullish(withFee) ? $i18n.core.continue : $i18n.core.lets_go}</button
176177
>
177178
</FactoryCredits>

src/frontend/src/lib/components/satellites/factory/CreateSatelliteMetadata.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<div class="toolbar">
4747
<button onclick={onback} type="button">{$i18n.core.back}</button>
4848

49-
<button {...testId(testIds.createSatellite.create)} {disabled} type="submit">
49+
<button {...testId(testIds.createSatellite.continueToOptions)} {disabled} type="submit">
5050
{$i18n.core.continue}
5151
</button>
5252
</div>

src/frontend/src/lib/components/satellites/factory/CreateSatelliteOptions.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<div class="toolbar">
8585
<button onclick={onback} type="button">{$i18n.core.back}</button>
8686

87-
<button {...testId(testIds.createSatellite.create)} {disabled} type="submit">
87+
<button {...testId(testIds.createSatellite.continueToReview)} {disabled} type="submit">
8888
{$i18n.core.review}
8989
</button>
9090
</div>

src/frontend/src/lib/constants/test-ids.constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const testIds = {
1313
actions: 'btn-open-actions'
1414
},
1515
createSatellite: {
16+
continueToMetadata: 'btn-continue-metadata',
17+
continueToOptions: 'btn-continue-options',
18+
continueToReview: 'btn-continue-review',
1619
create: 'btn-create-satellite',
1720
input: 'input-satellite-name',
1821
website: 'input-radio-satellite-website',

0 commit comments

Comments
 (0)