alessandro trinca tornidor commited on
Commit
7188967
·
1 Parent(s): fc6d805

test: improve the first e2e test

Browse files
static/e2e/samgis-be.spec.ts CHANGED
@@ -1,5 +1,6 @@
1
  import { test, expect } from '@playwright/test';
2
 
 
3
  test('test the driver.js tour on the localhost SamGIS-be page', async ({ page }) => {
4
  await page.goto('/');
5
  await expect(page.getByRole('dialog', { name: 'SamGIS' })).toBeVisible();
@@ -31,4 +32,17 @@ test('test the driver.js tour on the localhost SamGIS-be page', async ({ page })
31
  'Empty at beginning, this table will contain the machine learning prompt (points and rectangles) section'
32
  );
33
  await page.getByRole('button', { name: 'Done' }).click();
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  });
 
1
  import { test, expect } from '@playwright/test';
2
 
3
+
4
  test('test the driver.js tour on the localhost SamGIS-be page', async ({ page }) => {
5
  await page.goto('/');
6
  await expect(page.getByRole('dialog', { name: 'SamGIS' })).toBeVisible();
 
32
  'Empty at beginning, this table will contain the machine learning prompt (points and rectangles) section'
33
  );
34
  await page.getByRole('button', { name: 'Done' }).click();
35
+
36
+ const navigationMapLock = page.getByRole('checkbox', { name: 'map navigation unlocked' })
37
+ await expect(navigationMapLock).toBeVisible()
38
+ await expect(navigationMapLock).not.toBeChecked()
39
+
40
+ const mapLocator = page.locator("#map")
41
+ await expect(mapLocator).toBeVisible()
42
+ await expect(mapLocator).toMatchAriaSnapshot({ name: 'mapLocatorTestDriverJS.aria.yaml'})
43
+
44
+ const sendButton = page.getByRole('button', { name: 'Empty prompt (disabled)' })
45
+ await expect(sendButton).toBeVisible()
46
+ await expect(sendButton).toBeDisabled()
47
+ await page.close();
48
  });
static/e2e/samgis-be.spec.ts-snapshots/mapLocatorTestDriverJS-aria.yaml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - button "Zoom in"
2
+ - button "Zoom out"
3
+ - button
4
+ - button
5
+ - button
6
+ - button
7
+ - button
8
+ - button
9
+ - button "Layers"
10
+ - text: 2 km ©
11
+ - link "leaflet":
12
+ - /url: https://leafletjs.com
13
+ - text: ©
14
+ - link "OpenStreetMap":
15
+ - /url: https://www.openstreetmap.org/copyright
16
+ - text: contributors
static/playwright.config.ts CHANGED
@@ -35,17 +35,26 @@ export default defineConfig({
35
  projects: [
36
  {
37
  name: 'chromium',
38
- use: { ...devices['Desktop Chrome'] },
 
 
 
39
  },
40
 
41
  {
42
  name: 'firefox',
43
- use: { ...devices['Desktop Firefox'] },
 
 
 
44
  },
45
 
46
  {
47
  name: 'webkit',
48
- use: { ...devices['Desktop Safari'] },
 
 
 
49
  },
50
 
51
  /* Test against mobile viewports. */
 
35
  projects: [
36
  {
37
  name: 'chromium',
38
+ use: {
39
+ ...devices['Desktop Chrome'],
40
+ viewport: { width: 1920, height: 1080 },
41
+ },
42
  },
43
 
44
  {
45
  name: 'firefox',
46
+ use: {
47
+ ...devices['Desktop Firefox'],
48
+ viewport: { width: 1920, height: 1080 },
49
+ },
50
  },
51
 
52
  {
53
  name: 'webkit',
54
+ use: {
55
+ ...devices['Desktop Safari'],
56
+ viewport: { width: 1920, height: 1080 },
57
+ },
58
  },
59
 
60
  /* Test against mobile viewports. */