-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5717e70
commit 64ac220
Showing
9 changed files
with
1,005 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,53 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
let url = '/'; | ||
const username = 'admin'; | ||
const password = 'admin'; | ||
const authFile = 'auth.json'; | ||
|
||
test('authentication-setup', async ({ page }) => { | ||
await page.goto(url); | ||
|
||
const initialURL = page.url(); | ||
|
||
await expect(page.locator('h2')).toContainText('QGIS plugins web portal'); | ||
|
||
await expect(page.getByRole('link', { name: 'Login' })).toBeVisible(); | ||
|
||
await page.getByRole('link', { name: 'Login' }).click(); | ||
|
||
await page.waitForURL('**/accounts/login/'); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('Login using your OSGEO id.'); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('Please note that you do not need a login to download a plugin.'); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('You can create a new OSGEO id on OSGEO web portal.'); | ||
|
||
await expect(page.getByRole('link', { name: 'OSGEO web portal.' })).toBeVisible(); | ||
|
||
await page.getByLabel('User name:').click(); | ||
|
||
await page.getByLabel('User name:').fill(username); | ||
|
||
await page.getByLabel('Password:').click(); | ||
|
||
await page.getByLabel('Password:').fill(password); | ||
|
||
await expect(page.getByRole('button', { name: 'login' })).toBeVisible(); | ||
|
||
await page.getByRole('button', { name: 'login' }).click(); | ||
|
||
const finalURL = page.url(); | ||
|
||
await expect(initialURL).toBe(finalURL); | ||
|
||
await expect(page.getByRole('link', { name: 'Logout' })).toBeVisible(); | ||
|
||
await expect(page.locator('h2')).toContainText('QGIS plugins web portal'); | ||
|
||
await expect(page.getByRole('link', { name: '' })).toBeVisible(); | ||
|
||
await page.context().storageState({path: authFile}); | ||
|
||
}); |
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,80 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
let url = '/'; | ||
|
||
test.use({ | ||
storageState: 'auth.json' | ||
}); | ||
|
||
test('landing page', async ({ page }) => { | ||
await page.goto(url); | ||
|
||
await expect(page.locator('h2')).toContainText('QGIS plugins web portal'); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('There is a collection of plugins ready to be used, available to download. These plugins can also be installed directly from the QGIS Plugin Manager within the QGIS application.'); | ||
|
||
await expect(page.getByRole('link', { name: 'available to download' })).toBeVisible(); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('Notes for plugin users'); | ||
|
||
await expect(page.getByRole('link', { name: 'Developer mailing-list' })).toBeVisible(); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('Resources for plugin authors'); | ||
|
||
await expect(page.getByRole('link', { name: 'pyQGIS cookbook' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'QGIS Python API' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'QGIS C++ API' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'publish your plugins' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'QGIS Home' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'About plugins' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Plugins', exact: true })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Planet' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('button', { name: 'Hub' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Logout' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('heading', { name: 'Popular plugins' })).toBeVisible(); | ||
|
||
const pluginTags = page.getByRole('button', { name: ' Plugin Tags ' }); | ||
|
||
await expect(pluginTags).toBeVisible(); | ||
|
||
await pluginTags.click(); | ||
|
||
await expect(page.locator('#tagcloudModal').getByText('Plugin Tags')).toBeVisible(); | ||
|
||
await page.getByText('×').click(); | ||
|
||
await expect(page.locator('section').filter({ hasText: 'Sustaining Members' })).toBeVisible(); | ||
|
||
await expect(page.locator('header')).toContainText('Sustaining Members'); | ||
|
||
await expect(page.locator('#twitter').getByRole('link')).toBeVisible(); | ||
|
||
await expect(page.locator('#facebook').getByRole('link')).toBeVisible(); | ||
|
||
await expect(page.locator('#github').getByRole('link')).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Creative Commons Attribution-' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'The Noun Project collection' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Alessandro Pasotti' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Kartoza iconKartoza' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('contentinfo')).toBeVisible(); | ||
|
||
await expect(page.getByPlaceholder('Search')).toBeEmpty(); | ||
|
||
await expect(page.getByText('QGIS QGIS Home About plugins')).toBeVisible(); | ||
|
||
}); |
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,105 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
let url = '/'; | ||
|
||
test.use({ | ||
storageState: 'auth.json' | ||
}); | ||
|
||
test('plugins', async ({ page }) => { | ||
await page.goto(url); | ||
|
||
await expect(page.locator('h2')).toContainText('QGIS plugins web portal'); | ||
|
||
await expect(page.getByRole('link', { name: 'Plugins', exact: true })).toBeVisible(); | ||
|
||
await page.getByRole('link', { name: 'Plugins', exact: true }).click(); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('QGIS Python Plugins Repository'); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('All plugins'); | ||
|
||
await expect(page.locator('#list_commands')).toContainText('1 records found'); | ||
|
||
await expect(page.getByRole('cell', { name: 'Name' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Approved' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('img', { name: 'Approved' })).toBeVisible(); | ||
|
||
await expect(page.getByTitle('Featured')).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Downloads', exact: true })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Author' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Latest Plugin Version' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Created on' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Stars (votes)' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Stable' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Exp.' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Manage' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Plugin icon' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Coffee Plugin' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: '1.3' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: '1.4' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: '' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: ' Upload a plugin' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'My plugins' })).toBeVisible(); | ||
|
||
await expect(page.locator('#collapse-related-plugins')).toContainText('Plugins'); | ||
|
||
await expect(page.getByRole('link', { name: 'Unapproved' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Feedback received' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Feedback pending' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Deprecated' })).toBeVisible(); | ||
|
||
await expect(page.getByText('Featured')).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'All' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'New Plugins' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Updated Plugins' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Experimental' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Popular' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Most voted' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Top downloads' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'Most rated' })).toBeVisible(); | ||
|
||
await expect(page.getByRole('link', { name: 'QGIS Server plugins' })).toBeVisible(); | ||
|
||
await expect(page.locator('#maincolumn')).toContainText('× Deprecated plugins are printed in red.'); | ||
|
||
await expect(page.locator('section').filter({ hasText: 'Sustaining Members' })).toBeVisible(); | ||
|
||
await expect(page.locator('header')).toContainText('Sustaining Members'); | ||
|
||
await expect(page.getByRole('contentinfo')).toBeVisible(); | ||
|
||
await expect(page.locator('#twitter').getByRole('link')).toBeVisible(); | ||
|
||
await expect(page.locator('#facebook').getByRole('link')).toBeVisible(); | ||
|
||
await expect(page.locator('#github').getByRole('link')).toBeVisible(); | ||
}); |
Oops, something went wrong.