-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests - Move a minor tests from manual to playwright
- Loading branch information
1 parent
4adf5dd
commit af6e461
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// @ts-check | ||
import { test, expect } from '@playwright/test'; | ||
import { gotoMap } from './globals'; | ||
|
||
test.describe('Media', () => { | ||
test('Tests media are deleted', async ({ page }) => { | ||
|
||
var baseUrl = 'index.php/view/media/getMedia?repository=testsrepository&project=form_edition_all_field_type&path='; | ||
// on the feature from the "form_edition_upload" layer | ||
var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/text_file_mandatory/lorem-2.txt'); | ||
await expect(response).toBeOK(); | ||
|
||
var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/image_file_mandatory/random-2.jpg'); | ||
await expect(response).toBeOK(); | ||
|
||
var response = await page.request.get(baseUrl + '../media/specific_media_folder/random-4.jpg'); | ||
await expect(response).toBeOK(); | ||
|
||
// Open the attribute table | ||
const url = '/index.php/view/map?repository=testsrepository&project=form_edition_all_field_type'; | ||
await gotoMap(url, page); | ||
|
||
await page.locator('#button-attributeLayers').click(); | ||
|
||
let getFeatureRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeature') === true); | ||
|
||
await page.locator('#attribute-layer-list button[value="form_edition_upload"]').click(); | ||
await getFeatureRequestPromise; | ||
|
||
await page.getByRole('row', { name: '2 text_file_mandatory' }).getByRole('button').nth(2); | ||
|
||
// var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/text_file_mandatory/lorem-2.txt'); | ||
// await expect(response).toBeOK(); | ||
// | ||
// var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/image_file_mandatory/random-2.jpg'); | ||
// await expect(response).toBeFalsy(); | ||
// | ||
// var response = await page.request.get(baseUrl + '../media/specific_media_folder/random-4.jpg'); | ||
// await expect(response).toBeFalsy(); | ||
|
||
}) | ||
}) |