Skip to content

Commit

Permalink
FET-1573 remove page pause
Browse files Browse the repository at this point in the history
  • Loading branch information
SagiSan committed Sep 2, 2024
1 parent c5b0082 commit f791266
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions e2e/specs/stateless/myNames.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { afterEach } from 'node:test'

import { expect, Locator, Page } from '@playwright/test'
import { createAccounts } from '@root/playwright/fixtures/accounts'
import {
testClient,
waitForTransaction,
walletClient,
} from '@root/playwright/fixtures/contracts/utils/addTestContracts'
import { deleteSubnameFixture } from '@root/playwright/fixtures/makeName/generators/deleteSubname'
import { WrappedSubname } from '@root/playwright/fixtures/makeName/generators/generateWrappedSubname'
import { Address } from 'viem'
import { afterAll, beforeAll } from 'vitest'

import { deleteSubname } from '@ensdomains/ensjs/wallet'

Expand Down Expand Up @@ -49,7 +44,6 @@ test('myNames', async ({ page, login, makeName }) => {

await page.goto('/')
await login.connect('user2')
await page.pause()

await page.goto('/my/names')

Expand All @@ -63,8 +57,6 @@ test('myNames', async ({ page, login, makeName }) => {
)

expect(timestamps.every((timestamp) => timestamp === timestamps[0])).toBe(true)

await page.pause()
})

/// ///
Expand Down Expand Up @@ -259,8 +251,6 @@ test('Should display all expiry data (no expiry time)', async ({ page, login, ma
const nameLinks = page.locator('[data-testid="names-list"] div div a')
const descButton = page.locator('[data-testid="direction-button-desc"]')

await page.pause()

tempSubnames = temp.map(({ label }) => `${label}.${name}`)

expect(await nameLinks.count()).toBe(20)
Expand Down Expand Up @@ -294,19 +284,6 @@ test('Should display all expiry data (no expiry time)', async ({ page, login, ma
}

expect(await nameLinks.count()).toBe(30)

console.log('Cleaning up temp subnames')
for (const subname of tempSubnames) {
console.log(`Deleting subname: ${subname}`)
// eslint-disable-next-line no-await-in-loop
await deleteSubname(walletClient, {
name: subname,
contract: 'nameWrapper',
account: createAccounts().getAddress('user3') as Address,
})
}
tempSubnames = []
await page.pause()
})

test('Should display all expiry data (10 same expiry)', async ({ page, login, makeName }) => {
Expand Down Expand Up @@ -470,8 +447,6 @@ test('Should display all expiry data (30 same expiry, legacy)', async ({
const nameLinks = page.locator('[data-testid="names-list"] div div a')
const descButton = page.locator('[data-testid="direction-button-desc"]')

await page.pause()

expect(await nameLinks.count()).toBe(20)

for (let i = 0; i < 20; i += 1) {
Expand Down Expand Up @@ -591,14 +566,11 @@ test('Should display all expiry data (30 same expiry, subnames)', async ({
await login.connect('user3')
await page.goto('/my/names')

await page.pause()
await page.waitForSelector('[data-testid="names-list"]')

const nameLinks = page.locator('[data-testid="names-list"] div div a')
const descButton = page.locator('[data-testid="direction-button-desc"]')

// await page.pause()

expect(await nameLinks.count()).toBe(20)

for (let i = 0; i < 20; i += 1) {
Expand Down Expand Up @@ -674,6 +646,14 @@ test('Should display all expiry data (mix expiry/no expiry)', async ({ page, log
(_, i) => ({
label: `subname-${i}`,
owner: 'user3',
fuses: {
parent: {
named: ['PARENT_CANNOT_CONTROL'],
},
child: {
named: ['CANNOT_UNWRAP'],
},
},
}),
)

Expand All @@ -695,6 +675,9 @@ test('Should display all expiry data (mix expiry/no expiry)', async ({ page, log
label: 'wrapped-no-expiry',
type: 'wrapped',
duration: 3600,
fuses: {
named: ['CANNOT_UNWRAP'],
},
subnames: [...temp],
},
{
Expand All @@ -708,7 +691,9 @@ test('Should display all expiry data (mix expiry/no expiry)', async ({ page, log
},
]

await makeName(tempNames)
const names = await makeName(tempNames)

tempSubnames = temp.map(({ label }) => `${label}.${names[0]}`)

await page.goto('/')
await login.connect('user3')
Expand All @@ -720,7 +705,6 @@ test('Should display all expiry data (mix expiry/no expiry)', async ({ page, log
const descButton = page.locator('[data-testid="direction-button-desc"]')

expect(await nameLinks.count()).toBe(20)
await page.pause()
for (let i = 0; i < 10; i += 1) {
// eslint-disable-next-line no-await-in-loop
expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped-expiry/)
Expand Down

0 comments on commit f791266

Please sign in to comment.