LATEEK
LATEEK
NNuxt
Created by LATEEK on 4/12/2024 in #❓・help
Your feedback, what should I use ? Fork || Layer || Module ?
Given that I need to create multiple Nuxt website (like between 20 or 40), all based on the same set of components / composable / plugins / etc, but must allow overidde. ie: I wan't to ship a ready to use selling page, but still be able to use a specific component / page if I want. What would you advice ? - Create a classic nuxt app with all my core stuff (components / composable / plugins / ...), THEN fork the repo for every new projet. - Create a nuxt Layer with all my core stuff. - Create a nuxt module with all my core stuff. I'm not sure which one would be appropriate. I hope some experienced nuxt user could help me on this dilemma.
5 replies
NNuxt
Created by LATEEK on 3/29/2024 in #❓・help
Playwright 🎭 Tests parallelizations's execution times issue
Hi guys, I'm using playwright to test my app, but I can use parallelism without exploding test timing if I use :
import { expect, test } from '@nuxt/test-utils/playwright'
import { fileURLToPath } from 'node:url'

test.use({
trace: 'on-first-retry',
nuxt: {
rootDir: fileURLToPath(new URL('../playground/', import.meta.url))
}
})

test('Test1', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading').first()).toHaveText('Welcome')
})
import { expect, test } from '@nuxt/test-utils/playwright'
import { fileURLToPath } from 'node:url'

test.use({
trace: 'on-first-retry',
nuxt: {
rootDir: fileURLToPath(new URL('../playground/', import.meta.url))
}
})

test('Test1', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading').first()).toHaveText('Welcome')
})
My tests are working nicely, and I have the playwright --ui working great too. But the tests suite is SO LONG if I have the option fullyParallel: true. Of course, it have to build the app, and serve it before doing the first test, but it's like it is doing this for every test("..", async({page, goto})){ ... } So I tried to start the server myself and use baseURL: "http://localhost:3000" to force using the same server, like:
import { expect, test } from '@nuxt/test-utils/playwright'
import { fileURLToPath } from 'node:url';

test.use({
baseURL: "http://localhost:3000",
trace: 'on-first-retry',
nuxt: {
// rootDir: fileURLToPath(new URL('../playground/', import.meta.url))
}
})

test('Test1', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading').first()).toHaveText('Welcome')
})
import { expect, test } from '@nuxt/test-utils/playwright'
import { fileURLToPath } from 'node:url';

test.use({
baseURL: "http://localhost:3000",
trace: 'on-first-retry',
nuxt: {
// rootDir: fileURLToPath(new URL('../playground/', import.meta.url))
}
})

test('Test1', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading').first()).toHaveText('Welcome')
})
My tests seems to work correclty, and with a fast execution time, nice ! But then the playwright --ui is almost unusable at all because it doesn't show anything in its right part (timeline etc) So I guess using rootDir option is the correct way to go as the doc mention, but is possible to make parallel test using the same nuxt server ? Or did I miss something in the configuration ? Reproduction link: https://github.com/lateek35/nuxt-playwright-issue-reproduction I added 5 identical tests: - With 5 tests: 73sec to complete on my machine - With 1 test (comment the 4 others): 20sec
8 replies