Skip to content

Commit

Permalink
Wait for preflights maybe
Browse files Browse the repository at this point in the history
Alternate select

fix dupes

just use timeout

Use exact match on deploy button

Bump version
  • Loading branch information
pandemicsyn committed Aug 6, 2024
1 parent d265375 commit 0a57d1a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions e2e/playwright/tests/change-channel/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,27 @@ test('change channel', async ({ page }) => {
await page.getByRole('button', { name: 'Deploy' }).click();
await expect(page.locator('#app')).toContainText('Automated');
await changeChannel(ALTERNATE_CHANNEL_ID);

await page.getByText('Sync license').click();

await expect(page.getByLabel('Next step')).toContainText('License synced', { timeout: 10000 });
await page.getByRole('button', { name: 'Ok, got it!' }).click();

await expect(page.locator('#app')).toContainText('Alternate');
await expect(page.locator('#app')).toContainText('v1.0.1', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('1.0.3', { timeout: 10000 });
await expect(page.locator('#app')).toContainText('Upstream Update', { timeout: 10000 });

await page.waitForTimeout(5000);

await page.getByRole('button', { name: 'Deploy', exact: true }).click();
await page.getByRole('button', { name: 'Yes, Deploy' }).click();
await expect(page.getByText('v1.0.0')).not.toBeVisible();
await expect(page.getByText('v1.0.1')).toBeVisible();

await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 });
await expect(page.getByText('v1.0.0')).not.toBeVisible();
await expect(page.getByText('1.0.3')).toBeVisible();
});

async function changeChannel(channelId) {
async function changeChannel(channelId: string) {
await fetch(`https://api.replicated.com/vendor/v3/customer/${CUSTOMER_ID}`, {
method: 'PUT',
headers: {
Expand Down

0 comments on commit 0a57d1a

Please sign in to comment.