Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
30cb38e
Test commit
NinaEilers Jan 17, 2025
69e3bfe
this is a test file, help me to find out why it
NinaEilers Feb 25, 2025
24a5eda
please find out why this functions recording and
NinaEilers Feb 25, 2025
074e670
commited one files and modified two files
NinaEilers Mar 1, 2025
4a71890
rename e2e/menu-links-working.ts -> e2e/menu-links-working.spec.ts
NinaEilers Mar 2, 2025
ea66843
added all tests for menu links
NinaEilers Mar 2, 2025
b0f0ae4
foto upload now working
NinaEilers Mar 4, 2025
81166f6
clean up tests for fotos-to-add and menu-links-working test files
NinaEilers Mar 7, 2025
bb55a79
add e2e tests for fotos to add and menu links
NinaEilers Mar 8, 2025
a88f387
first commit on ER University building test
NinaEilers Mar 25, 2025
6deabf5
first commit try
NinaEilers Apr 8, 2025
c24de21
To get result in the final version
NinaEilers Apr 13, 2025
88ca637
to get Changes staged, use new WC room
NinaEilers May 11, 2025
13c6307
finalize commit message
NinaEilers May 26, 2025
0fc4f82
change names of e2e tests to be more descriptive
NinaEilers May 27, 2025
0d32fd5
delete this file to avoid having it twice
NinaEilers May 27, 2025
ea98633
delete e2e/how-to-get-there.spec.ts because is is double with e2e/ber…
NinaEilers May 27, 2025
65b611d
just a modification
NinaEilers Jun 1, 2025
d5a0696
added the test if the toilet is wide enough for a wheelchair
NinaEilers Jun 3, 2025
7311709
Fix base URLs for berlin-technical-unversity.spec.ts
opyh Jul 30, 2025
38b81f7
Use only one PlayWright worker locally
opyh Jul 30, 2025
149f366
Fix several PlayWright tests (WIP)
opyh Jul 30, 2025
9fe259c
Improve several tests
NinaEilers Aug 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added e2e/1000015934.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added e2e/10000200152.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions e2e/add-a-new-place.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

import { test } from '@playwright/test';
import getBaseURL from './lib/base-url';
const baseURL = getBaseURL();


test('Add a new place', async ({ page }) => {
await page.goto(baseURL);
await page.getByRole('link', { name: 'Add a new place' }).click();
await page.waitForLoadState();
await page.waitForURL('https://wheelmap.pro/organizations/LPb4y2ri7b6fLxLFa/survey-projects/wx4mM8xFiQAsB5aLi/show?step=data.osm_place');
});


// Removed unused custom locator function
126 changes: 126 additions & 0 deletions e2e/berlin-technical-unversity.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { test, expect } from './lib/axe-test';
import getBaseURL from './lib/base-url';

const baseURL = getBaseURL();

// Get Playwright config and report it to the console

test.beforeEach(async ({ page }) => {
// Go to the starting url before each test.
// await page.goto(baseURL);
// await skipOnboarding(page);
// console.log(`Playwright config: ${JSON.stringify(test.info().config, null, 2)}`);
// console.log(process.env.CI_TEST_DEPLOYMENT_BASE_URL);
});

test('should allow editing accessibility status from partially accessible to fully accessible for TU Berlin ER building', async ({ page }) => {
await page.goto(`${baseURL}/buildings/way%3A23517902?category=&q=&wheelchair=unknown&toilet=yes&lat=52.51096600&lon=13.32576500&extent=13.3248001&extent=52.5113331&extent=13.3267297&extent=52.5105994&zoom=18.74388041`);
await page.waitForLoadState();
await page.getByText('ER',{ exact: true}).click();
await page.waitForLoadState();
await page.getByText('University building').click();
await page.waitForLoadState();
await page.click('text="Access"');
await page.click('text="Partially wheelchair accessible"');
await page.waitForLoadState();
await expect(page.getByRole('button', { name: 'Edit' })).toBeVisible();

});

test('should display building floor information showing 4 levels when clicking Look section', async ({ page }) => {
await page.goto(`${baseURL}/buildings/way%3A23517902?category=&q=&wheelchair=unknown&toilet=yes&lat=52.51096600&lon=13.32576500&extent=13.3248001&extent=52.5113331&extent=13.3267297&extent=52.5105994&zoom=18.74388041`);
await page.waitForLoadState();
await page.click('text="Look"');
await page.waitForLoadState();
await expect(page.getByText('4 levels')).toBeVisible();
await page.waitForLoadState();
});


test('should display Technische UniversitΓ€t Berlin as building operator when clicking Operator section', async ({ page }) => {
await page.goto(`${baseURL}/buildings/way%3A23517902?category=&q=&wheelchair=unknown&toilet=yes&lat=52.51096600&lon=13.32576500&extent=13.3248001&extent=52.5113331&extent=13.3267297&extent=52.5105994&zoom=18.74388041`);
await page.waitForLoadState();
await page.click('text="Operator"');
await page.waitForLoadState();
await page.click('text="Technische UniversitΓ€t Berlin"');
await page.waitForLoadState();
await expect(page.getByText('Technische UniversitΓ€t Berlin')).toBeVisible();
await page.waitForLoadState();
});

test('should display user review comments with MySmiley integration for ER University building', async ({ page }) => {
await page.goto(`${baseURL}/buildings/way%3A23517902?category=&q=&wheelchair=unknown&toilet=yes&lat=52.51096600&lon=13.32576500&extent=13.3248001&extent=52.5113331&extent=13.3267297&extent=52.5105994&zoom=18.74388041`);
await page.waitForLoadState();
await expect(page.getByRole('cell', { name: 'πŸ§‘ β€œEs gibt auf der' })).toBeVisible();
await page.waitForLoadState();
await expect(page.getByRole('cell', { name: 'πŸ§‘ β€œEs gibt auf der' }).getByRole('button')).toBeVisible();

});

test('should navigate to nearest wheelchair-accessible toilet and edit accessibility information for both non-accessible and accessible WCs', async ({ page }) => {
await page.goto(`${baseURL}/buildings/way%3A23517902?category=&q=&wheelchair=unknown&toilet=yes&lat=52.51096600&lon=13.32576500&extent=13.3248001&extent=52.5113331&extent=13.3267297&extent=52.5105994&zoom=18.74388041`);
await page.waitForLoadState();

// Navigate to first (non-accessible) toilet
await page.getByRole('link', { name: 'Next wheelchair-accessible WC' }).click();
await page.waitForLoadState();

// Edit first toilet - mark as not wheelchair accessible
await page.getByText('Access', { exact: true }).click();
await page.getByText('Not wheelchair accessible').click();
await page.getByTestId('wheelchair').click();
//enter into access dialog
await page.getByText ('Not at all').click();
await page.getByRole('button',{ name: 'Confirm'}).click();
await page.waitForLoadState();

// Fill additional toilet information
await page.getByText('Payment', { exact: true }).click();
await page.getByText('No fees').click();
await page.getByRole('cell', { name: 'For whom?', exact:true }).click();
await page.getByText('Access for customers').click();
await page.getByRole('cell', { name: 'Add a description', exact:true }).click();
await page.getByTestId('wheelchair:description:en').click();
//enter into description dialog
await page.getByText('Please describe how').click();
await page.getByRole('button', { name: 'Confirm' }).click();
await page.waitForLoadState();

// Verify distance updated and navigate to next toilet
await expect(page.getByText('Next wheelchair-accessible WC 0 m')).toBeVisible();
await page.getByRole('link', { name: 'Next wheelchair-accessible WC' }).click();
await page.waitForLoadState();

// Edit second toilet - mark as wheelchair accessible
await page.getByLabel('Toilets').getByRole('button').click();
await page.getByText('Toilets').click();
await page.getByRole('cell', { name: 'Access', exact:true }).click();
await page.getByText('Fully wheelchair accessible').click();
await page.getByTestId('wheelchair').click();

// Enter into access dialog
await page.getByTestId('dialog').getByText('Fully').click();
await page.getByRole('button',{ name: 'Confirm'}).click();
await page.waitForLoadState();
await page.getByRole('cell', { name: 'Location', exact:true }).click();
await page.getByText('Ground floor').click();
await page.getByRole('cell', { name: 'Payment', exact:true }).click();
await page.getByText('No fees').click();
await page.getByRole('cell', { name: 'For whom?', exact:true }).click();
await page.getByText('Access for customers').click();
await page.getByRole('cell', { name: 'WC', exact:true }).click();
await page.getByText('Accessible WC').click();
await page.getByTestId('toilets:wheelchair').click();

// Enter into toilets dialog
await page.getByText('Is this toilet wheelchair').click();
await page.getByRole('radio', { name: 'Fully' }).click();
await page.getByRole('button', { name: 'Cancel' }).click();
await page.waitForLoadState();
await page.getByRole('cell', { name: 'Add a description', exact:true }).click();
//enter into description dialog
await page.getByTestId('wheelchair:description:en').click();
await page.getByText('Please describe how').click();
await page.getByRole('button', { name: 'Confirm' }).click();
await page.waitForLoadState();
});
65 changes: 65 additions & 0 deletions e2e/berliner-monuments.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import useSubmitNewValueCallback from '~/lib/fetchers/osm-api/makeChangeRequestToOsmApi';
import { test, expect } from './lib/axe-test';
import getBaseURL from './lib/base-url';
import { skipOnDesktops, skipOnMobiles } from './lib/device-type';
import { skipOnboarding } from './skipOnboarding';

const baseURL = getBaseURL();

test.beforeEach(async ({ page }) => {
// Go to the starting url before each test.
//await page.goto(baseURL);
//await skipOnboarding(page);
});

test('opens Victory Column on OpenStreetMap', async ({ page }) => {
await page.goto('https://feature-a11ymap.wheelmap.tech/composite/ac:PlaceInfo:WcdW6a8tJumrqsswk,buildings:way:718035022');
await page.waitForLoadState();
//goto Open Street Map
await page.getByRole('link', { name: 'Open on OpenStreetMap' }).click();
await page.waitForLoadState();
skipOnMobiles();
await expect(page.getByRole('heading', { name: 'Großer Stern' })).toBeVisible();
await expect(page.getByText('Victory Column')).toBeVisible();
await page.waitForLoadState();

});

test('opens Victory Column on Bing Maps', async ({ page }) => {
//test('Goto Open on Apple Maps', async ({ page }) => {
await page.goto('https://feature-a11ymap.wheelmap.tech/composite/ac:PlaceInfo:WcdW6a8tJumrqsswk,buildings:way:718035022');
await page.waitForLoadState();
skipOnMobiles();
//goto Bing Maps
await page.getByRole('link', { name: 'Open on Bing Maps' }).click();
await page.waitForLoadState();
await expect(page.getByRole('heading', { name: 'Großer Stern' })).toBeVisible();
await expect(page.getByText('Victory Column')).toBeVisible();
await page.waitForLoadState();
});

test('displays Swiss Embassy address', async ({ page }) => {
await page.goto('https://feature-a11ymap.wheelmap.tech/composite/amenities:relation:2886766,buildings:relation:2886766');
await page.waitForLoadState();
await expect(page.getByText('Otto-von-Bismarck-Allee')).toBeVisible();
await page.waitForLoadState();
await expect(page.getByRole('heading', { name: 'Embassy of Switzerland' })).toBeVisible();
});

test('displays Swiss Embassy website link', async ({ page }) => {
await page.goto('https://feature-a11ymap.wheelmap.tech/composite/amenities:relation:2886766,buildings:relation:2886766');
await page.waitForLoadState();
await expect(page.getByText('https://www.eda.admin.ch/berlin.html')).toBeVisible();
await page.goto('http://www.eda.admin.ch/berlin.html');
await page.waitForLoadState();
await expect(page.locator('text=Schweiz und Deutschland').first()).toBeVisible();
});

test('displays Swiss Embassy phone number', async ({ page }) => {
await page.goto('https://feature-a11ymap.wheelmap.tech/composite/amenities:relation:2886766,buildings:relation:2886766');
await page.waitForLoadState();
await expect(page.getByText('Call +49 30 390 40 00')).toBeVisible();
await page.waitForLoadState();
await page.locator('text=Call +49 30 390 40 00').first().click();
await page.waitForLoadState();
});
81 changes: 81 additions & 0 deletions e2e/fotos-to-add.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { test, expect } from '@playwright/test';
import { skipOnboarding } from './skipOnboarding';
import getBaseURL from './lib/base-url';
const baseURL = getBaseURL();
import { skipOnMobiles, skipOnDesktops } from './lib/device-type';
const dialogSelector = 'dialog[data-state="open"]';

async function waitForDialogToBeStable(page) {
const dialog = await page.$(dialogSelector);
// Needed to wait for the dialog to be fully opaque/non-transparent before running the accessibility scan
await dialog?.waitForElementState('stable');
}

test('has base URL', async ({ page }) => {
await page.goto(baseURL);

});

test('upload a photo', async ({ page }) => {
try {
await page.goto(baseURL);
// await skipOnboarding(page);
await page.goto(baseURL + '/amenities/way:30050297');
// Click on the "Add new image" link
await page.getByRole('link', { name: 'Add new image' }).click();
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Select image' }).click();
// Upload an image
await page.locator('input[type=file]').setInputFiles('./e2e/1000015934.jpg');
await page.getByRole('button', { name: 'Upload image' }).click();
}
catch (error) {
console.error('Test failed with error:', error.message);
console.error(error.stack);
throw error;
}
});


test.describe("when the menu is closed", () => {
test('has correct ARIA snapshot on desktops', async ({ page }) => {

skipOnMobiles();
await page.goto(baseURL);
// await skipOnboarding(page);
// On desktops, the greater part of the navigation is always visible.
await expect(page.getByRole('banner')).toMatchAriaSnapshot(`
- banner:
- link "Home":
- img
- text: Find wheelchair accessible places.
- navigation:
- list:
- listitem:
- link "Get involved"
- listitem:
- link "News"
- listitem:
- link "Press"
- listitem:
- link "Events"
- listitem:
- link "Add a new place"
- button "Show menu"
`);
});


test('has correct ARIA snapshot on mobiles', async ({ page }) => {
skipOnDesktops();
await page.goto(baseURL);
await skipOnboarding(page);
await expect(page.getByRole('banner')).toMatchAriaSnapshot(`
- banner:
- link "Home":
- img "Wheelmap logo"
- navigation:
- button "Show menu"
`);
});
});
1 change: 1 addition & 0 deletions e2e/main-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test.describe("when the menu is closed", () => {
`);
});


test('has correct ARIA snapshot on mobiles', async ({ page }) => {
skipOnDesktops();
await expect(page.getByRole('banner')).toMatchAriaSnapshot(`
Expand Down
60 changes: 60 additions & 0 deletions e2e/menu-links-working.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { test, expect } from '@playwright/test';
import { skipOnboarding } from './skipOnboarding';
import getBaseURL from './lib/base-url';
const baseURL = getBaseURL();
import { skipOnMobiles, skipOnDesktops } from './lib/device-type';
const dialogSelector = 'dialog[data-state="open"]';

/**
* Helper function to click a banner link and return the new tab
* @param page - The current page object
* @param linkName - The name of the link to click
* @returns The new tab that opens
*/
async function clickBannerLinkAndGetNewTab(page: any, linkName: string) {
await page.waitForURL('https://feature-a11ymap.wheelmap.tech/');
// Wait for the new tab to open
const newTabPromise = page.waitForEvent('popup');
await page.getByRole('banner').getByRole('link', { name: linkName }).click();
const newTab = await newTabPromise;
await newTab.waitForLoadState();
return newTab;
}

test.beforeEach(async ({ page }) => {
// Go to the starting url before each test.
await page.goto(baseURL);
await skipOnboarding(page);
});

test('Get involved', async ({ page }) => {
const newTab = await clickBannerLinkAndGetNewTab(page, 'Get involved');
// Check if the URL and title of the new tab are correct
await expect(newTab).toHaveURL("https://news.wheelmap.org/en/wheelmap-ambassador-program-2021/");
await expect(newTab).toHaveTitle("Wheelmap Ambassador Program 2021 – Wheelmap.org");
});

test('News', async ({ page }) => {
const newTab = await clickBannerLinkAndGetNewTab(page, 'News');
// Check if the URL of the new tab is correct
await expect(newTab).toHaveURL('https://news.wheelmap.org/en/#news');
});

test('Press', async ({ page }) => {
const newTab = await clickBannerLinkAndGetNewTab(page, 'Press');
// Check if the URL of the new tab is correct
await expect(newTab).toHaveURL('https://news.wheelmap.org/en/press/');
});

test('Events', async ({ page }) => {
await page.waitForURL('https://feature-a11ymap.wheelmap.tech/');
await page.getByRole('banner').getByRole('link', { name: 'Events' }).click();
// Check if the URL is correct
await expect(page).toHaveURL('https://feature-a11ymap.wheelmap.tech/events');
});

test('Add a new place', async ({ page }) => {
const newTab = await clickBannerLinkAndGetNewTab(page, 'Add a new place');
// Check if the URL of the new tab is correct
await expect(newTab).toHaveURL('https://wheelmap.pro/organizations/LPb4y2ri7b6fLxLFa/survey-projects/wx4mM8xFiQAsB5aLi/show?step=data.osm_place');
});
Empty file added e2e/test-data/buildings.ts
Empty file.
Empty file added e2e/test-data/constants.ts
Empty file.
Empty file added e2e/test-data/index.ts
Empty file.
Loading