Skip to content

Commit

Permalink
Spsh 959 config browsers (#93)
Browse files Browse the repository at this point in the history
* added browser in playwright.config

* new action for browsertests firefox

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes
  • Loading branch information
jakobmadp authored Nov 19, 2024
1 parent 4536cdd commit 6623393
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/manuell_staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Manuell alle Tests(staging)
name: Manuell stage long
on:
workflow_dispatch:
jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: ENV='stage' FRONTEND_URL='https://spsh.staging.spsh.dbildungsplattform.de/' npx playwright test -g "@stage"
run: ENV='stage' FRONTEND_URL='https://spsh.staging.spsh.dbildungsplattform.de/' npx playwright test -g "@stage" --project "chromium"
env:
USER: '${{ secrets.USER }}'
PW: '${{ secrets.PW }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: List Playwright tests
run: npx playwright test --list --grep "@short"
- name: Run Playwright tests
run: npx playwright test --config=playwright.config.ts --grep "@short"
run: npx playwright test --config=playwright.config.ts --grep "@short" --project "chromium"

env:
USER: '${{ secrets.USER }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/schedule_dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Scheduled Playwright Alle Tests(main)
name: Scheduled main long
on:
workflow_dispatch:
schedule:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: ENV='dev' FRONTEND_URL='https://main.dev.spsh.dbildungsplattform.de/' npx playwright test -g "@long"
run: ENV='dev' FRONTEND_URL='https://main.dev.spsh.dbildungsplattform.de/' npx playwright test -g "@long" --project "chromium"
env:
USER: '${{ secrets.USER }}'
PW: '${{ secrets.PW }}'
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/schedule_dev_crossBrowser_Firefox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Scheduled main crossBrowser Firefox
on:
workflow_dispatch:
schedule:
- cron: '10 6 * * *'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Remove Microsoft APT and Update Packages
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update || true
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: ENV='dev' FRONTEND_URL='https://main.dev.spsh.dbildungsplattform.de/' npx playwright test -g "@crossBrowser" --project "firefox"
env:
USER: '${{ secrets.USER }}'
PW: '${{ secrets.PW }}'
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30npm login
- uses: RocketChat/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: 'Playwright Job Status: '
url: ${{ secrets.RC_WEBHOOK }}
channel: '#SPSH-Test-Automation'
username: Playwright Notificator
4 changes: 2 additions & 2 deletions .github/workflows/schedule_staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Scheduled Playwright Smoketest(staging)
name: Scheduled stage smoke
on:
workflow_dispatch:
schedule:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: ENV='stage' FRONTEND_URL='https://spsh.staging.spsh.dbildungsplattform.de/' npx playwright test -g "@smoke"
run: ENV='stage' FRONTEND_URL='https://spsh.staging.spsh.dbildungsplattform.de/' npx playwright test -g "@smoke" --project "chromium"
env:
USER: '${{ secrets.USER }}'
PW: '${{ secrets.PW }}'
Expand Down
3 changes: 2 additions & 1 deletion base/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const LONG = '@long';
export const SHORT = '@short';
export const STAGE = '@stage';
export const SMOKE = '@smoke';
export const SMOKE = '@smoke';
export const BROWSER = '@crossBrowser';
26 changes: 14 additions & 12 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,22 @@ export default defineConfig({
use: {
...devices["Desktop Chrome"],
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
},
ignoreHTTPSErrors: true
}
},

{
name: "firefox",
use: {
...devices["Desktop Firefox"],
ignoreHTTPSErrors: true
}
}

// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
/*
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
*/
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// }

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
Expand Down
4 changes: 2 additions & 2 deletions tests/Klasse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { KlasseCreationViewPage } from "../pages/admin/KlasseCreationView.page";
import { KlasseManagementViewPage } from "../pages/admin/KlasseManagementView.page";
import { faker } from "@faker-js/faker/locale/de";
import { HeaderPage } from "../pages/Header.page";
import { LONG, SHORT, STAGE } from "../base/tags";
import { LONG, SHORT, STAGE, BROWSER } from "../base/tags";
import { deleteClassByName } from "../base/testHelperDeleteTestdata.ts";

const PW = process.env.PW;
Expand Down Expand Up @@ -100,7 +100,7 @@ test.describe(`Testfälle für die Administration von Klassen: Umgebung: ${proce
});
});

test("Eine Klasse als Landesadmin anlegen und die Bestätigungsseite vollständig prüfen", {tag: [LONG, STAGE]}, async ({ page }) => {
test("Eine Klasse als Landesadmin anlegen und die Bestätigungsseite vollständig prüfen", {tag: [LONG, STAGE, BROWSER]}, async ({ page }) => {
const klasseCreationView = new KlasseCreationViewPage(page);
const dienststellennummer = '1111111';
const nameSchule = "Testschule Schulportal";
Expand Down
4 changes: 2 additions & 2 deletions tests/MenuBar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StartPage } from '../pages/StartView.page';
import { LoginPage } from '../pages/LoginView.page';
import { MenuPage } from '../pages/MenuBar.page';
import { HeaderPage } from "../pages/Header.page";
import { LONG, SHORT, STAGE } from '../base/tags';
import { LONG, SHORT, STAGE, BROWSER } from '../base/tags';

const PW = process.env.PW;
const ADMIN = process.env.USER;
Expand All @@ -31,7 +31,7 @@ test.describe(`Testfälle für die Hauptmenue-Leiste: Umgebung: ${process.env.UM
});
});

test('Test der Hauptmenue-Leiste und Untermenues auf Vollständigkeit', {tag: [LONG, SHORT, STAGE]}, async ({ page }) => {
test('Test der Hauptmenue-Leiste und Untermenues auf Vollständigkeit', {tag: [LONG, SHORT, STAGE, BROWSER]}, async ({ page }) => {
const startseite = new StartPage(page)
const menuBar = new MenuPage(page);

Expand Down
4 changes: 2 additions & 2 deletions tests/Person.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { createRolleAndPersonWithUserContext } from "../base/api/testHelperPerso
import { getSPId } from "../base/api/testHelperServiceprovider.page";
import { UserInfo } from "../base/api/testHelper.page";
import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page";
import { LONG, SHORT, STAGE } from "../base/tags";
import { LONG, SHORT, STAGE, BROWSER } from "../base/tags";
import { deletePersonByUsername, deleteRolleById, deleteRolleByName } from "../base/testHelperDeleteTestdata.ts";
import { landesadminRolle, schuelerRolle, schuladminOeffentlichRolle } from "../base/roles.ts";

Expand Down Expand Up @@ -304,7 +304,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
});
});

test("Ergebnisliste Benutzer auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, SHORT, STAGE]}, async ({page }) => {
test("Ergebnisliste Benutzer auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, SHORT, STAGE, BROWSER]}, async ({page }) => {
const startseite = new StartPage(page);
const menue = new MenuPage(page);
const personManagementView = new PersonManagementViewPage(page);
Expand Down
4 changes: 2 additions & 2 deletions tests/Profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createRolleAndPersonWithUserContext, addSecondOrganisationToPerson } fr
import { getOrganisationId } from "../base/api/testHelperOrganisation.page";
import { UserInfo } from "../base/api/testHelper.page";
import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page";
import { LONG, SHORT, STAGE } from "../base/tags";
import { LONG, SHORT, STAGE, BROWSER } from "../base/tags";
import { deleteRolleById, deletePersonByUsername} from "../base/testHelperDeleteTestdata";

const PW = process.env.PW;
Expand Down Expand Up @@ -64,7 +64,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e
});
});

test("Das eigene Profil öffnen und auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, STAGE]}, async ({ page }) => {
test("Das eigene Profil öffnen und auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, STAGE, BROWSER]}, async ({ page }) => {
const profileView = new ProfilePage(page);
const header = new HeaderPage(page);
const login = new LoginPage(page);
Expand Down
4 changes: 2 additions & 2 deletions tests/Schule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getSPId } from "../base/api/testHelperServiceprovider.page";
import { UserInfo } from "../base/api/testHelper.page";
import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page";
import { FooterDataTablePage } from "../pages/FooterDataTable.page";
import { LONG, SHORT, STAGE } from "../base/tags";
import { LONG, SHORT, STAGE, BROWSER } from "../base/tags";
import { deletePersonById, deleteRolleById } from "../base/testHelperDeleteTestdata";

const PW = process.env.PW;
Expand Down Expand Up @@ -123,7 +123,7 @@ test.describe(`Testfälle für die Administration von Schulen: Umgebung: ${proce
});
});

test("Ergebnisliste Schulen auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, SHORT, STAGE]}, async ({ page }) => {
test("Ergebnisliste Schulen auf Vollständigkeit prüfen als Landesadmin", {tag: [LONG, SHORT, STAGE, BROWSER]}, async ({ page }) => {
const startseite = new StartPage(page);

await test.step(`Schulverwaltung öffnen und Alle Elemente in der Ergebnisliste auf Existenz prüfen`, async () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LoginPage } from '../pages/LoginView.page';
import { LandingPage } from '../pages/LandingView.page';
import { StartPage } from '../pages/StartView.page';
import { HeaderPage } from "../pages/Header.page";
import { LONG, SHORT, SMOKE, STAGE } from '../base/tags';
import { LONG, SHORT, SMOKE, STAGE, BROWSER } from '../base/tags';
import { createRolleAndPersonWithUserContext, lockPerson } from "../base/api/testHelperPerson.page.ts";
import { getSPId } from "../base/api/testHelperServiceprovider.page.ts";
import { faker } from "@faker-js/faker/locale/de";
Expand Down Expand Up @@ -70,7 +70,7 @@ test.describe(`Testfälle für die Authentifizierung: Umgebung: ${process.env.UM
}
});

test('Erfolgreicher Standard Login Landesadmin', {tag: [LONG, SMOKE, STAGE]}, async ({ page }) => {
test('Erfolgreicher Standard Login Landesadmin', {tag: [LONG, SMOKE, STAGE, BROWSER]}, async ({ page }) => {
const login = new LoginPage(page);
const landing = new LandingPage(page);
const start = new StartPage(page);
Expand Down
6 changes: 3 additions & 3 deletions tests/workflow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ItsLearningPage } from "../pages/Cards/ItsLearning.page";
import { PersonManagementViewPage } from "../pages/admin/PersonManagementView.page";
import { PersonDetailsViewPage } from "../pages/admin/PersonDetailsView.page";
import { HeaderPage } from "../pages/Header.page";
import { LONG, SHORT, STAGE } from "../base/tags";
import { LONG, SHORT, STAGE, BROWSER } from "../base/tags";
import { CalendarPage } from "../pages/Cards/Calendar.page";
import { DirectoryPage } from "../pages/Cards/Directory.page";
import { createTeacherAndLogin } from "../base/api/testHelperPerson.page";
Expand Down Expand Up @@ -84,7 +84,7 @@ test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.E
});
});

test("Passwort Reset für einen Lehrer als Landesadmin", {tag: [LONG, SHORT, STAGE]}, async ({ page }) => {
test("Passwort Reset für einen Lehrer als Landesadmin", {tag: [LONG, SHORT, STAGE, BROWSER]}, async ({ page }) => {
const landing = new LandingPage(page);
const login = new LoginPage(page);
const startseite = new StartPage(page);
Expand All @@ -103,7 +103,7 @@ test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.E
await expect(personManagement.text_h2_Benutzerverwaltung).toBeVisible();
await personManagement.input_Suchfeld.fill(username);
await personManagement.button_Suchen.click();
await page.getByRole("cell", { name: lastname, exact: true }).click();
await page.getByRole("cell", { name: lastname, exact: true }).click({delay:500});
});

await test.step(`In den User-Details PW-Reset Dialog starten`, async () => {
Expand Down

0 comments on commit 6623393

Please sign in to comment.