Skip to content

Commit

Permalink
test: fix node selection
Browse files Browse the repository at this point in the history
  • Loading branch information
m8vago committed Dec 5, 2024
1 parent 4ade99b commit 7204739
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ test.describe('Versioned Project', () => {
await page.goto(TEAM_ROUTES.deployment.list())
await page.waitForSelector('h2:text-is("Deployments")')

await page.getByPlaceholder('Search').fill(prefix)

const copyButton = await page.locator(`[alt="Copy"]:right-of(:has-text("${projectName}"))`).first()
await copyButton.click()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ test.describe('Versionless Project', () => {
await page.goto(TEAM_ROUTES.deployment.list())
await page.waitForSelector('h2:text-is("Deployments")')

await page.getByPlaceholder('Search').fill(prefix)

const copyButton = await page.locator(`[alt="Copy"]:right-of(:has-text("${projectName}"))`).first()
await copyButton.click()

await page.locator(`button:has-text("${nodeName}"):above(:has-text("Projects"))`).click()
await page.locator(`button:has-text("${nodeName}"):above(:has-text("Prefix"))`).click()

Check failure on line 46 in web/crux-ui/e2e/with-login/deployment/deployment-copyability-versionless.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[deployment] › with-login/deployment/deployment-copyability-versionless.spec.ts:29:7 › Versionless Project › deployment should not be copiable to the same node with the same prefix

1) [deployment] › with-login/deployment/deployment-copyability-versionless.spec.ts:29:7 › Versionless Project › deployment should not be copiable to the same node with the same prefix Error: locator.click: Error: strict mode violation: locator('button:has-text("versionless-copiability-same-node-same-prefix"):above(:has-text("Prefix"))') resolved to 2 elements: 1) <button type="button" class="rounded-md border-2 px-2 py…>versionless-copiability-same-node-same-prefix</button> aka getByRole('button', { name: 'versionless-copiability-same-' }).nth(1) 2) <button type="button" class="rounded-md border-2 px-2 py…>versionless-copiability-same-node-same-prefix</button> aka getByRole('button', { name: 'versionless-copiability-same-' }).first() Call log: - waiting for locator('button:has-text("versionless-copiability-same-node-same-prefix"):above(:has-text("Prefix"))') 44 | await copyButton.click() 45 | > 46 | await page.locator(`button:has-text("${nodeName}"):above(:has-text("Prefix"))`).click() | ^ 47 | await fillDeploymentPrefix(page, prefix) 48 | await page.locator('button:has-text("Copy")').click() 49 | at /__w/dyrectorio/dyrectorio/web/crux-ui/e2e/with-login/deployment/deployment-copyability-versionless.spec.ts:46:85
await fillDeploymentPrefix(page, prefix)
await page.locator('button:has-text("Copy")').click()

Expand Down Expand Up @@ -69,7 +71,7 @@ test.describe('Versionless Project', () => {
const copyButton = page.locator('button:has-text("Copy")')
await copyButton.click()

await page.locator(`button:has-text("${otherNode}")`).click()
await page.locator(`button:has-text("${otherNode}"):above(:has-text("Prefix"))`).click()
await fillDeploymentPrefix(page, prefix)

const currentUrl = page.url()
Expand All @@ -96,7 +98,7 @@ test.describe('Versionless Project', () => {
const copyButton = page.locator('button:has-text("Copy")')
await copyButton.click()

await page.locator(`button:has-text("${nodeName}")`).click()
await page.locator(`button:has-text("${nodeName}"):above(:has-text("Prefix"))`).click()
await fillDeploymentPrefix(page, `${prefix}-new-prefix`)

const currentUrl = page.url()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ test('Deleting a deployment should refresh deployment list', async ({ page }) =>
await page.goto(TEAM_ROUTES.deployment.list())
await page.waitForSelector('h2:text-is("Deployments")')

await page.getByPlaceholder('Search').fill(projectName)

await deleteRefreshDeployment()
await expect(page.locator(`.p-2:has-text('pw-${projectName}')`)).toHaveCount(1)
await deleteRefreshDeployment()
Expand Down

0 comments on commit 7204739

Please sign in to comment.