diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 25decfd32..5c3f66098 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -1,13 +1,15 @@ - -FROM mcr.microsoft.com/playwright:v1.30.0-focal@sha256:9e6eddb08b8566076ef778007859096bc90f8984236061c086eaede2fb60430b +FROM mcr.microsoft.com/playwright:v1.36.0-jammy@sha256:3d3619bf5e622d264f519bffd3aa321d061bf420688eda8a5143da7884b36a6b WORKDIR /app -RUN npm install -D @playwright/test@v1.30.0 -RUN npm ci +RUN npm install -D @playwright/test@v1.36.1 RUN npx playwright install --with-deps +# Need to be installed since the package.json is not copied +RUN npm i @terrestris/shogun-e2e-tests@v1.0.7 +RUN npm i dotenv@v16.3.1 + COPY playwright.config.js ./ -COPY global-setup.js ./ +COPY global-setup.ts ./ COPY ./src/e2e-tests ./e2e-tests COPY ./playwright ./playwright diff --git a/src/e2e-tests/draw-annotation.spec.ts b/src/e2e-tests/draw-annotation.spec.ts index 151a0a8a9..cd3045ca0 100644 --- a/src/e2e-tests/draw-annotation.spec.ts +++ b/src/e2e-tests/draw-annotation.spec.ts @@ -12,5 +12,7 @@ test('draw-annotation', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await annotations(page, workerInfo); }); diff --git a/src/e2e-tests/draw.spec.ts b/src/e2e-tests/draw.spec.ts index 21c435612..de3d40feb 100644 --- a/src/e2e-tests/draw.spec.ts +++ b/src/e2e-tests/draw.spec.ts @@ -12,5 +12,6 @@ test('draw', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.getByRole('button', {name: 'draw'}).click(); await draw(page); }); diff --git a/src/e2e-tests/drawCircle.spec.ts b/src/e2e-tests/drawCircle.spec.ts index 6bf6178ce..48574be8a 100644 --- a/src/e2e-tests/drawCircle.spec.ts +++ b/src/e2e-tests/drawCircle.spec.ts @@ -12,5 +12,7 @@ test('draw-circle', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawCircle(page, workerInfo); }); diff --git a/src/e2e-tests/drawDelete.spec.ts b/src/e2e-tests/drawDelete.spec.ts index f70bb8545..0579d682b 100644 --- a/src/e2e-tests/drawDelete.spec.ts +++ b/src/e2e-tests/drawDelete.spec.ts @@ -12,5 +12,7 @@ test('draw-delete', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawDelete(page, workerInfo); }); diff --git a/src/e2e-tests/drawEdit.spec.ts b/src/e2e-tests/drawEdit.spec.ts index 0e83f6a6c..91c45aaac 100644 --- a/src/e2e-tests/drawEdit.spec.ts +++ b/src/e2e-tests/drawEdit.spec.ts @@ -12,5 +12,7 @@ test('draw-edit', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawEdit(page, workerInfo); }); diff --git a/src/e2e-tests/drawExport.spec.ts b/src/e2e-tests/drawExport.spec.ts index 32ead2d47..a1e6032cc 100644 --- a/src/e2e-tests/drawExport.spec.ts +++ b/src/e2e-tests/drawExport.spec.ts @@ -12,5 +12,7 @@ test('draw-export', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawExport(page, workerInfo); }); diff --git a/src/e2e-tests/drawLine.spec.ts b/src/e2e-tests/drawLine.spec.ts index 8da63daa1..b9effd7ab 100644 --- a/src/e2e-tests/drawLine.spec.ts +++ b/src/e2e-tests/drawLine.spec.ts @@ -12,5 +12,7 @@ test('draw-line', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawLine(page, workerInfo); }); diff --git a/src/e2e-tests/drawModifyColorScheme.spec.ts b/src/e2e-tests/drawModifyColorScheme.spec.ts index c10fe966c..1d79908ea 100644 --- a/src/e2e-tests/drawModifyColorScheme.spec.ts +++ b/src/e2e-tests/drawModifyColorScheme.spec.ts @@ -12,5 +12,7 @@ test('draw-modify', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawModifyColorScheme(page); }); diff --git a/src/e2e-tests/drawPoint.spec.ts b/src/e2e-tests/drawPoint.spec.ts index 3ade43964..db04014d9 100644 --- a/src/e2e-tests/drawPoint.spec.ts +++ b/src/e2e-tests/drawPoint.spec.ts @@ -12,5 +12,7 @@ test('draw-point', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawPoint(page, workerInfo); }); diff --git a/src/e2e-tests/drawPolygon.spec.ts b/src/e2e-tests/drawPolygon.spec.ts index fdfc6eb6d..695241b26 100644 --- a/src/e2e-tests/drawPolygon.spec.ts +++ b/src/e2e-tests/drawPolygon.spec.ts @@ -12,5 +12,7 @@ test('draw-polygon', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawPolygon(page, workerInfo); }); diff --git a/src/e2e-tests/drawRectangle.spec.ts b/src/e2e-tests/drawRectangle.spec.ts index a08464bfd..e3a6fa508 100644 --- a/src/e2e-tests/drawRectangle.spec.ts +++ b/src/e2e-tests/drawRectangle.spec.ts @@ -12,5 +12,7 @@ test('draw-rectangle', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawRectangle(page, workerInfo); }); diff --git a/src/e2e-tests/drawUpload.spec.ts b/src/e2e-tests/drawUpload.spec.ts index 52e541850..99ea66b15 100644 --- a/src/e2e-tests/drawUpload.spec.ts +++ b/src/e2e-tests/drawUpload.spec.ts @@ -12,5 +12,7 @@ test('draw-upload', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Draw' }).click(); await drawUpload(page, workerInfo); }); diff --git a/src/e2e-tests/exportPrint.spec.ts b/src/e2e-tests/exportPrint.spec.ts index c07ff5dd4..72a4ab0f6 100644 --- a/src/e2e-tests/exportPrint.spec.ts +++ b/src/e2e-tests/exportPrint.spec.ts @@ -12,5 +12,7 @@ test('draw-print', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Export' }).click(); await exportPrint(page); }); diff --git a/src/e2e-tests/languageSelector.spec.ts b/src/e2e-tests/languageSelector.spec.ts index 7b93fbf76..7acf46755 100644 --- a/src/e2e-tests/languageSelector.spec.ts +++ b/src/e2e-tests/languageSelector.spec.ts @@ -12,5 +12,7 @@ test('language-selector', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Language selector' }).click(); await languageSelector(page); }); diff --git a/src/e2e-tests/layertree.spec.ts b/src/e2e-tests/layertree.spec.ts index fde7cf946..0745e54b7 100644 --- a/src/e2e-tests/layertree.spec.ts +++ b/src/e2e-tests/layertree.spec.ts @@ -12,5 +12,7 @@ test('layertree', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Maps' }).click(); await layertree(page, workerInfo); }); diff --git a/src/e2e-tests/measure.spec.ts b/src/e2e-tests/measure.spec.ts index 6e90bbb28..27b57ad29 100644 --- a/src/e2e-tests/measure.spec.ts +++ b/src/e2e-tests/measure.spec.ts @@ -12,5 +12,7 @@ test('measure', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Measure' }).click(); await measure(page); }); diff --git a/src/e2e-tests/share.spec.ts b/src/e2e-tests/share.spec.ts index 0167cfd49..03c3a08f1 100644 --- a/src/e2e-tests/share.spec.ts +++ b/src/e2e-tests/share.spec.ts @@ -13,5 +13,7 @@ test('share', async ({ await page.goto(`https://${process.env.HOST}/client/?applicationId=${process.env.ID}`); + await page.waitForLoadState('networkidle'); + await page.getByRole('button', { name: 'Share' }).click(); await share(page, context, workerInfo); });