From fbb77ff657d8c231e8a78c56e899365bac4978b0 Mon Sep 17 00:00:00 2001 From: Mike Delez <60604010+mdelez@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:28:22 +0100 Subject: [PATCH] test(dsp-app): add cypress e2e test framework (#1161) Co-authored-by: Rebeccasigloch <136320187+RebeccaSigloch2@users.noreply.github.com> --- .github/workflows/main.yml | 29 +- .gitignore | 4 + README.md | 20 +- apps/dsp-app-e2e/cypress.config.ts | 12 + .../create_project.cy.ts | 16 + .../dsp-app-e2e/cypress/fixtures/example.json | 5 + .../cypress/fixtures/user_profiles.json | 13 + apps/dsp-app-e2e/cypress/global.d.ts | 13 + .../cypress/models/user-profiles.ts | 18 + .../cypress/support/commands/login.ts | 38 + apps/dsp-app-e2e/cypress/support/e2e.ts | 34 + apps/dsp-app-e2e/project.json | 57 +- apps/dsp-app-e2e/protractor-ci.conf.js | 10 - apps/dsp-app-e2e/protractor.conf.js | 31 - apps/dsp-app-e2e/src/app.e2e-spec.ts | 143 - apps/dsp-app-e2e/src/footer.e2e-spec.ts | 447 -- apps/dsp-app-e2e/src/help.e2e-spec.ts | 240 - apps/dsp-app-e2e/src/login.e2e-spec.ts | 108 - apps/dsp-app-e2e/src/page-objects/app.po.ts | 63 - .../dsp-app-e2e/src/page-objects/footer.po.ts | 63 - apps/dsp-app-e2e/src/page-objects/help.po.ts | 55 - apps/dsp-app-e2e/src/page-objects/login.po.ts | 31 - apps/dsp-app-e2e/tsconfig.e2e.json | 9 - apps/dsp-app-e2e/tsconfig.json | 9 + .../description/description.component.html | 2 +- .../project-form/project-form.component.html | 3 +- package-lock.json | 5111 +++++++++++------ package.json | 9 +- 28 files changed, 3698 insertions(+), 2895 deletions(-) create mode 100644 apps/dsp-app-e2e/cypress.config.ts create mode 100644 apps/dsp-app-e2e/cypress/e2e/System_Admin/System_Admin_functions/Project_administration/create_project.cy.ts create mode 100644 apps/dsp-app-e2e/cypress/fixtures/example.json create mode 100644 apps/dsp-app-e2e/cypress/fixtures/user_profiles.json create mode 100644 apps/dsp-app-e2e/cypress/global.d.ts create mode 100644 apps/dsp-app-e2e/cypress/models/user-profiles.ts create mode 100644 apps/dsp-app-e2e/cypress/support/commands/login.ts create mode 100644 apps/dsp-app-e2e/cypress/support/e2e.ts delete mode 100644 apps/dsp-app-e2e/protractor-ci.conf.js delete mode 100644 apps/dsp-app-e2e/protractor.conf.js delete mode 100644 apps/dsp-app-e2e/src/app.e2e-spec.ts delete mode 100644 apps/dsp-app-e2e/src/footer.e2e-spec.ts delete mode 100644 apps/dsp-app-e2e/src/help.e2e-spec.ts delete mode 100644 apps/dsp-app-e2e/src/login.e2e-spec.ts delete mode 100644 apps/dsp-app-e2e/src/page-objects/app.po.ts delete mode 100644 apps/dsp-app-e2e/src/page-objects/footer.po.ts delete mode 100644 apps/dsp-app-e2e/src/page-objects/help.po.ts delete mode 100644 apps/dsp-app-e2e/src/page-objects/login.po.ts delete mode 100644 apps/dsp-app-e2e/tsconfig.e2e.json create mode 100644 apps/dsp-app-e2e/tsconfig.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6a35b2cbb..c4032c57ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,34 @@ jobs: - run: npx nx run dsp-app:test:ci env: TZ: Europe/Zurich - # - run: npx nx run dsp-app-e2e:e2e-ci + + dsp-app-e2e-tests: + name: DSP-APP E2E + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # gets additionally all tags which we need + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install + - name: Checkout DSP-API repo + uses: actions/checkout@v3 + with: + repository: dasch-swiss/dsp-api + ref: main + path: dsp-api + - name: start API + run: | + cd dsp-api + make init-db-test + docker compose -f docker-compose.yml up -d sipi ingest api + ./webapi/scripts/wait-for-api.sh + - name: run e2e tests + run: | + cd ../dsp-das + npm run e2e-ci dateadapter-tests: name: DateAdapter diff --git a/.gitignore b/.gitignore index 9c59722586..521a3850e6 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,7 @@ Thumbs.db .angular /libs/jdnconvertiblecalendar/coverage/ + +#E2E +/.nx +apps/dsp-app-e2e/cypress/screenshots diff --git a/README.md b/README.md index 234f596ea6..a359941406 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,14 @@ The monorepo is implemented using [NX](https://nx.dev). The most common commands are defined in `package.json`. -> **_NOTE:_** You can install `nx` globally with `npm install -g nx`. If not, then all `nx` commands bellow need to be prefixed with `npx`. +> **_NOTE:_** You can install `nx` globally with `npm install -g nx`. If not, then all `nx` commands below need to be prefixed with `npx`. | nx | npm | |---------------------------------------------------------------|-------------------------------------| | `nx run dsp-app:test` | `npm run test-local` | -| `nx run dsp-app:test --watch=false --browsers=ChromeHeadless` | `npm run test-ci` | +| `nx run dsp-app:test:ci` | `npm run test-ci` | +| `nx run-many --all --target=test --configuration=ci` | `npm run test-ci-all` | +| `nx run dsp-app:serve` | `npm run start-dev` | | `nx run dsp-app:serve:test-server` | `npm run start-with-test-server` | | `nx run dsp-app:serve:dev-server` | `npm run start-with-dev-server` | | `nx run dsp-app:serve:ls-test-server` | `npm run start-with-ls-test-server` | @@ -52,15 +54,25 @@ The most common commands are defined in `package.json`. | `nx run dsp-app:serve:0845-test-server` | `npm run start-with-0845-server` | | `nx run dsp-app:lint` | `npm run lint-ci` | | `nx run dsp-app:lint --fix` | `npm run lint-local` | -| `nx run dsp-app-e2e:e2e` | `npm run e2e` | -| `nx run dsp-app-e2e:e2e-ci --webdriver-update=false` | `npm run e2e-ci` | +| `nx run dsp-app-e2e:e2e:development` | `npm run e2e-ci-dev` | +| `nx run dsp-app-e2e:e2e:production` | `npm run e2e-ci` | | `nx run dsp-app:build` | `build` | | `nx run dsp-app:build:production` | `build-prod` | +| npx | npm | +|---------------------------------------------------------------|-------------------------------------| +| `cd apps/dsp-app-e2e && npx cypress open` | `npm run e2e-local` | + ### IDE plugins - https://plugins.jetbrains.com/plugin/15101-nx-console-idea - https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console +### E2E Tests +- There are three spm scripts to run the E2E tests. +- `npm run e2e-ci-dev` will run the E2E tests in the console in a development environment. +- `npm run e2e-ci` will run the E2E tests in the console in a production environment. This is the command that is run on GitHub CI. +- `npm run e2e-local` will open the Cypress UI which will enable you to easy run individual tests and see every step as it runs. + ## Further Documentation diff --git a/apps/dsp-app-e2e/cypress.config.ts b/apps/dsp-app-e2e/cypress.config.ts new file mode 100644 index 0000000000..41b5cb2760 --- /dev/null +++ b/apps/dsp-app-e2e/cypress.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "cypress"; + +export default defineConfig({ + e2e: { + specPattern: 'cypress/**/**/**/*.cy.ts', + excludeSpecPattern: ['*.spec.js', '*.spec.ts'], + baseUrl: "http://localhost:4200", + env: { + apiUrl: "http://0.0.0.0:3333", + } + }, +}); diff --git a/apps/dsp-app-e2e/cypress/e2e/System_Admin/System_Admin_functions/Project_administration/create_project.cy.ts b/apps/dsp-app-e2e/cypress/e2e/System_Admin/System_Admin_functions/Project_administration/create_project.cy.ts new file mode 100644 index 0000000000..799cc8284e --- /dev/null +++ b/apps/dsp-app-e2e/cypress/e2e/System_Admin/System_Admin_functions/Project_administration/create_project.cy.ts @@ -0,0 +1,16 @@ +describe('create new project', () => { + it('should create a new project', () => { + cy.visit('/'); + cy.get('.create-project-button button').click(); + cy.get("#mat-input-0").type("0123"); + cy.get("#mat-input-1").type("test"); + cy.get("#mat-input-2").type("Test Project"); + cy.get("#mat-input-3").type("this is a test project"); + cy.get("#mat-mdc-chip-list-input-0").type("project"); + cy.get("#mat-mdc-chip-list-input-0").type("{enter}"); + cy.get("#mat-mdc-chip-list-input-0").type("test"); + cy.get("#mat-mdc-chip-list-input-0").type("{enter}"); + cy.get("div.app-content span.mdc-button__label > span").click(); + cy.get('.project-longname').should('contain', 'Test Project'); + }); +}); diff --git a/apps/dsp-app-e2e/cypress/fixtures/example.json b/apps/dsp-app-e2e/cypress/fixtures/example.json new file mode 100644 index 0000000000..02e4254378 --- /dev/null +++ b/apps/dsp-app-e2e/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/apps/dsp-app-e2e/cypress/fixtures/user_profiles.json b/apps/dsp-app-e2e/cypress/fixtures/user_profiles.json new file mode 100644 index 0000000000..f80f7b592b --- /dev/null +++ b/apps/dsp-app-e2e/cypress/fixtures/user_profiles.json @@ -0,0 +1,13 @@ +{ + "admin_username": "daschAdmin", + "admin_password": "DaSCHianer1", + "change_admin_password": "DaSCHianer2", + "projectMember_username": "daschMember", + "projectMember_password": "AMembersPassword1", + "change_projectMember_password": "AMembersPassword2", + "systemAdmin_username": "daschSystemAdmin", + "systemAdmin_password": "IamAllowedTODoEverything1", + "systemAdmin_username_root": "root", + "systemAdmin_password_root": "test", + "change_systemAdmin_password": "IamAllowedTODoEverything2" +} diff --git a/apps/dsp-app-e2e/cypress/global.d.ts b/apps/dsp-app-e2e/cypress/global.d.ts new file mode 100644 index 0000000000..ae0e54e48d --- /dev/null +++ b/apps/dsp-app-e2e/cypress/global.d.ts @@ -0,0 +1,13 @@ +declare namespace Cypress { + + // I can't import User from user-profiles without the linter breaking and idk why + interface User { + username: string; + password: string; + } + + interface Chainable { + // logs user in via the API + login(user: User): void; + } +} diff --git a/apps/dsp-app-e2e/cypress/models/user-profiles.ts b/apps/dsp-app-e2e/cypress/models/user-profiles.ts new file mode 100644 index 0000000000..342e740598 --- /dev/null +++ b/apps/dsp-app-e2e/cypress/models/user-profiles.ts @@ -0,0 +1,18 @@ +export interface User { + username: string; + password: string; +} + +export interface UserProfiles { + admin_username: string; + admin_password: string; + change_admin_password: string; + projectMember_username: string; + projectMember_password: string; + change_projectMember_password: string; + systemAdmin_username: string; + systemAdmin_password: string; + systemAdmin_username_root: string; + systemAdmin_password_root: string; + change_systemAdmin_password: string; +} diff --git a/apps/dsp-app-e2e/cypress/support/commands/login.ts b/apps/dsp-app-e2e/cypress/support/commands/login.ts new file mode 100644 index 0000000000..3573c6bdef --- /dev/null +++ b/apps/dsp-app-e2e/cypress/support/commands/login.ts @@ -0,0 +1,38 @@ +import { User } from "../../models/user-profiles"; + +Cypress.Commands.add('login', (user: User) => { + cy.session(user, () => { + + cy.request({ + method: 'POST', + url: `${Cypress.env("apiUrl")}/v2/authentication`, + body: { + username: user.username, + password: user.password + } + }).then((response) => { + const session = { + id: 123456789, + user: { + name: "root", + jwt: response.body.token, + lang: "de", + sysAdmin: true, + projectAdmin: [] + } + + }; + + localStorage.setItem('session', JSON.stringify(session)); + localStorage.setItem('cookieBanner', 'false'); + cy.visit('/'); + cy.get('rn-banner').shadow().find('.rn-close-btn').click(); + }); + }, + { + validate: () => { + const session = localStorage.getItem('session'); + expect(session).to.exist; + } + }); +}); diff --git a/apps/dsp-app-e2e/cypress/support/e2e.ts b/apps/dsp-app-e2e/cypress/support/e2e.ts new file mode 100644 index 0000000000..860e5acb27 --- /dev/null +++ b/apps/dsp-app-e2e/cypress/support/e2e.ts @@ -0,0 +1,34 @@ +import './commands/login'; +import { UserProfiles } from '../models/user-profiles'; + +// do things here before each test if needed +// All active session data (cookies, localStorage and sessionStorage) across all domains are cleared. +beforeEach(() => { + let users: UserProfiles; + cy.readFile('cypress/fixtures/user_profiles.json').then( + (json: UserProfiles) => { + // read JSON data file + users = json; + + if (Cypress.spec.relative.startsWith('cypress/e2e/System_Admin')) { + cy.login({ + username: users.systemAdmin_username_root, + password: users.systemAdmin_password_root, + }); + } + + if ( + Cypress.spec.relative.startsWith('cypress/e2e/Project_Member') + ) { + cy.login({ + username: users.projectMember_username, + password: users.projectMember_password + }); + } + } + ); +}); + +// do things here after each test if needed +// afterEach(() => { +// }); diff --git a/apps/dsp-app-e2e/project.json b/apps/dsp-app-e2e/project.json index 6194e248d0..f1d07aa076 100644 --- a/apps/dsp-app-e2e/project.json +++ b/apps/dsp-app-e2e/project.json @@ -3,56 +3,27 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "apps/dsp-app-e2e/src", "projectType": "application", + "prefix": "dsp-app-e2e", "targets": { "e2e": { - "executor": "@angular-devkit/build-angular:protractor", + "executor": "@nrwl/cypress:cypress", "options": { - "protractorConfig": "apps/dsp-app-e2e/protractor.conf.js", - "devServerTarget": "dsp-app:serve" + "cypressConfig": "apps/dsp-app-e2e/cypress.config.ts" }, "configurations": { "production": { - "devServerTarget": "dsp-app:serve:production" - }, - "test-server": { - "devServerTarget": "dsp-app:serve:test-server" - }, - "ls-test-server": { - "devServerTarget": "dsp-app:serve:ls-test-server" - }, - "0845-test-server": { - "devServerTarget": "dsp-app:serve:0845-test-server" - }, - "staging-server": { - "devServerTarget": "dsp-app:serve:staging-server" - } - } - }, - "e2e-ci": { - "executor": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "apps/dsp-app-e2e/protractor-ci.conf.js", - "devServerTarget": "dsp-app:serve" - }, - "configurations": { - "production": { - "devServerTarget": "dsp-app:serve:production" - }, - "test-server": { - "devServerTarget": "dsp-app:serve:test-server" - }, - "ls-test-server": { - "devServerTarget": "dsp-app:serve:ls-test-server" - }, - "0845-test-server": { - "devServerTarget": "dsp-app:serve:0845-test-server" - }, - "staging-server": { - "devServerTarget": "dsp-app:serve:staging-server" + "devServerTarget": "dsp-app:serve:production", + "env": { + "API_URL": "http://0.0.0.0:3333/api" + } + }, + "development": { + "devServerTarget": "dsp-app:serve:development", + "env": { + "API_URL": "http://0.0.0.0:3333/api" + } } } } - }, - "implicitDependencies": ["dsp-app"], - "tags": [] + } } diff --git a/apps/dsp-app-e2e/protractor-ci.conf.js b/apps/dsp-app-e2e/protractor-ci.conf.js deleted file mode 100644 index c87a9ef55a..0000000000 --- a/apps/dsp-app-e2e/protractor-ci.conf.js +++ /dev/null @@ -1,10 +0,0 @@ -const config = require('./protractor.conf').config; - -config.capabilities = { - browserName: 'chrome', - chromeOptions: { - args: ['--headless', '--no-sandbox', '--disable-gpu'], - }, -}; - -exports.config = config; diff --git a/apps/dsp-app-e2e/protractor.conf.js b/apps/dsp-app-e2e/protractor.conf.js deleted file mode 100644 index 2625593768..0000000000 --- a/apps/dsp-app-e2e/protractor.conf.js +++ /dev/null @@ -1,31 +0,0 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/lib/config.ts - -const { SpecReporter } = require('jasmine-spec-reporter'); - -exports.config = { - allScriptsTimeout: 11000, - specs: ['./src/**/*.e2e-spec.ts'], - capabilities: { - browserName: 'chrome', - }, - directConnect: true, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine', - SELENIUM_PROMISE_MANAGER: false, - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function () {}, - }, - onPrepare() { - require('ts-node').register({ - project: require('path').join(__dirname, './tsconfig.e2e.json'), - }); - jasmine - .getEnv() - .addReporter( - new SpecReporter({ spec: { displayStacktrace: true } }) - ); - }, -}; diff --git a/apps/dsp-app-e2e/src/app.e2e-spec.ts b/apps/dsp-app-e2e/src/app.e2e-spec.ts deleted file mode 100644 index 62cae2084d..0000000000 --- a/apps/dsp-app-e2e/src/app.e2e-spec.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { AppPage } from './page-objects/app.po'; -import { browser, element, by, protractor } from 'protractor'; - -describe('landing page', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display welcome title', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getMainTitle()).toEqual( - 'BRING ALL TOGETHER AND SIMPLIFY YOUR RESEARCH' - ); - }); - - it('should display help button', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getHelpButton().getText()).toEqual('Help'); - }); - - it('should route to help page', async () => { - const EC = protractor.ExpectedConditions; - const isClickable = EC.elementToBeClickable(page.getHelpButton()); - - await browser.waitForAngularEnabled(false); - page.navigateTo(); - browser.wait(isClickable, 5000); - page.getHelpButton().click(); - await browser.waitForAngularEnabled(true); - expect(page.getHelpPageTitle()).toEqual('Need help?'); - }); - - it('should display login button', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getLoginButton().getText()).toEqual('LOGIN'); - }); - - it('should route to login page', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - page.getLoginButton().click(); - await browser.waitForAngularEnabled(true); - expect(page.getLoginPageTitle()).toEqual('Login here'); - }); - - it('should display accept button in the cookie banner', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getAcceptCookieButton().getText()).toEqual('ACCEPT'); - }); - - it('should go back to home page', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - page.getAcceptCookieButton().click(); - await browser.waitForAngularEnabled(true); - expect(page.getSubtitle()).toContain( - 'a software framework for storing' - ); - }); - - it('should display dasch logo', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getUnibasLogo().getAttribute('class')).toEqual( - 'logo logo-unibas' - ); - }); - - it('should route to the dasch website and check the URL', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - element( - by.css('img[src="/assets/images/logo-unibas.jpg"]') - ).click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://www.unibas.ch/de' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should display 5 dasch public projects', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getProjects().count()).toEqual(5); - }); - - it('should get the name of the second project of the list (which is BEOL project)', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(page.getBEOLProjectTitle().getText()).toEqual( - 'Bernoulli-Euler Online' - ); - }); - - it('should route to the beol page', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - page.getReadMoreBtnOfBEOL().click(); - await browser.waitForAngularEnabled(true); - expect(page.getBEOLProjectPageTitle()).toEqual( - 'Bernoulli-Euler Online' - ); - }); -}); diff --git a/apps/dsp-app-e2e/src/footer.e2e-spec.ts b/apps/dsp-app-e2e/src/footer.e2e-spec.ts deleted file mode 100644 index f0dd9e5730..0000000000 --- a/apps/dsp-app-e2e/src/footer.e2e-spec.ts +++ /dev/null @@ -1,447 +0,0 @@ -import { browser } from 'protractor'; -import { FooterPage } from './page-objects/footer.po'; - -describe('footer', () => { - let footer: FooterPage; - - beforeEach(() => { - footer = new FooterPage(); - }); - - it('should start the description with "DSP-APP is built with"', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - expect(footer.getFooterText()).toContain('DSP-APP is built with'); - }); - - it('should route to Angular page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getAngularLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://angular.io' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to Angular Material page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getMaterialLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://material.angular.io' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to DSP-API doc page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getKnoraLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://www.knora.org' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to Sipi page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getSipiLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://sipi.io' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to SAGW page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getSAGWLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'http://sagw.ch' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to SwissUniversities page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getSwissUniversitiesLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'http://swissuniversities.ch' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to SNF page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getSNFLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual('http://snf.ch'); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to DaSCH page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getDaSCHLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://dasch.swiss' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to DaSCH github page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getDaSCHgitHubLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://www.github.com/dasch-swiss' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to DaSCH twitter page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getTwitterLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://twitter.com/DaSCHSwiss' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to DaSCH facebook page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getFacebookLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://facebook.com/dasch.swiss' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to Bernoullistrasse google map page', async () => { - await browser.waitForAngularEnabled(false); - footer.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - footer.getBernoulistrasseMapLink().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toEqual( - 'https://www.google.com/maps/place/Bernoullistrasse+32%2C+4056+Basel' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); -}); diff --git a/apps/dsp-app-e2e/src/help.e2e-spec.ts b/apps/dsp-app-e2e/src/help.e2e-spec.ts deleted file mode 100644 index ee8e97cf47..0000000000 --- a/apps/dsp-app-e2e/src/help.e2e-spec.ts +++ /dev/null @@ -1,240 +0,0 @@ -import { browser } from 'protractor'; -import { HelpPage } from './page-objects/help.po'; -import packageJson from '../../../package.json'; - -describe('help page', () => { - let page: HelpPage; - - beforeEach(() => { - page = new HelpPage(); - }); - - it('should display page title', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - expect(page.getPageTitle()).toEqual('Need help?'); - }); - - it('should route to project management documentation', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getProjManagementDocButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://docs.dasch.swiss/user-guide/project/' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to dsp-app release note page', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getKnoraAppReleaseNotesButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://github.com/dasch-swiss/' + - packageJson.name + - '/releases/tag/v' + - packageJson.version - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to sipi release note page', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getSipiReleaseNotesButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://github.com/dasch-swiss/Sipi/releases/tag/v2.0.0' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should have a mailto link to support@dasch.swiss', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getDaschContactButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - // --> TODO: why is still working? The address doesn't exist anymore. It was replaced by "mailto:support@dasch.swiss?subject=...." - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://discuss.dasch.swiss/' - ); - // todo: check if link is still alive or broken - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to the DaSCH website', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getDaschSwissButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://dasch.ch/' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); - - it('should route to the dasch-swiss Github repo', async () => { - await browser.waitForAngularEnabled(false); - page.navigateTo(); - await browser.waitForAngularEnabled(true); - - browser.getWindowHandle().then(function (parentGUID) { - // click the link that opens in a new window - page.getGithubContributeButton().click(); - browser.sleep(5000); - // get the all the session ids of the opened tabs - browser.getAllWindowHandles().then(function (allGUID) { - // console.log('Number of tabs opened: ' + allGUID.length); - // iterate through the tabs - for (const guid of allGUID) { - // find the new browser tab - if (guid !== parentGUID) { - // switch to the tab - browser.switchTo().window(guid); - // break the loop - break; - } - } - // perform here any actions needed on the new tab - expect(browser.driver.getCurrentUrl()).toMatch( - 'https://github.com/dasch-swiss' - ); - - // close the new tab - browser.close(); - - // switch back to the parent tab - browser.switchTo().window(parentGUID); - }); - }); - }); -}); diff --git a/apps/dsp-app-e2e/src/login.e2e-spec.ts b/apps/dsp-app-e2e/src/login.e2e-spec.ts deleted file mode 100644 index 7857f35583..0000000000 --- a/apps/dsp-app-e2e/src/login.e2e-spec.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { LoginPage } from './page-objects/login.po'; -import { browser, by, protractor } from 'protractor'; - -describe('login page', () => { - let page: LoginPage; - - function performLogin() { - const loginBtn = page.getLoginButton(); - const EC = protractor.ExpectedConditions; - const isClickable = EC.elementToBeClickable(loginBtn); - - browser.wait(isClickable, 7000); - loginBtn.click(); - browser.waitForAngular(); - } - - function performLogout() { - const userMenuBtn = browser.findElement( - by.css('app-user-menu button.user-menu') - ); - userMenuBtn.click(); - - browser.executeScript(` - const button = document.querySelector('.menu-action.logout'); - button.click();`); - } - - beforeEach(() => { - page = new LoginPage(); - }); - - it('should display page title', async () => { - await browser.waitForAngularEnabled(false); - page.navigateToLogin(); - await browser.waitForAngularEnabled(true); - expect(page.getPageTitle()).toEqual('Login here'); - }); - - it('should log in', async () => { - const username = page.getUsername(); - const password = page.getPassword(); - - await browser.waitForAngularEnabled(false); - page.navigateToLogin(); - - // fill input fields - username.sendKeys('root'); - password.sendKeys('test'); - - await browser.waitForAngularEnabled(true); - - // check fields contain the entered value - expect(username.getAttribute('value')).toEqual('root'); - expect(password.getAttribute('value')).toEqual('test'); - - // log in - await browser.waitForAngularEnabled(false); - performLogin(); - await browser.waitForAngularEnabled(true); - - // check the user has been redirected to the dashboard - expect(browser.driver.getCurrentUrl()).toMatch('/dashboard'); - expect(page.getDashboardTitle()).toContain('Welcome'); - - // check the session - await browser.waitForAngularEnabled(false); - const value = browser.executeScript( - "return window.localStorage.getItem('session');" - ); - await browser.waitForAngularEnabled(true); - - expect(value).toBeTruthy(); - expect(value).toContain('"name":"root"'); - }); - - // TODO: find another solution to target the logout button - /* xit('should log out', async () => { - - const username = page.getUsername(); - const password = page.getPassword(); - - await browser.waitForAngularEnabled(false); - page.navigateToLogin(); - - // fill input fields - username.sendKeys('root'); - password.sendKeys('test'); - - await browser.waitForAngularEnabled(true); - - // log in - await browser.waitForAngularEnabled(false); - performLogin(); - await browser.waitForAngularEnabled(true); - - // to FIX: log out > logout button cannot be found - await browser.waitForAngularEnabled(false); - performLogout(); - await browser.waitForAngularEnabled(true); - - expect(page.getPageTitle()).toEqual('Login here'); - expect(browser.getCurrentUrl()).toContain('/login?returnUrl=%2Fdashboard'); - - // check the session - const value = await browser.executeScript("return window.localStorage.getItem('session');"); - expect(value).toBe(null); - }); */ -}); diff --git a/apps/dsp-app-e2e/src/page-objects/app.po.ts b/apps/dsp-app-e2e/src/page-objects/app.po.ts deleted file mode 100644 index 3dfe5d222a..0000000000 --- a/apps/dsp-app-e2e/src/page-objects/app.po.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { browser, by, element } from 'protractor'; - -export class AppPage { - navigateTo() { - return browser.get('/'); - } - - getMainTitle() { - return element(by.css('app-main h1')).getText(); - } - - getSubtitle() { - return element(by.css('app-main h2')).getText(); - } - - getHelpButton() { - return element(by.buttonText('Help')); - } - - getHelpPageTitle() { - return element(by.css('app-help h1')).getText(); - } - - getLoginButton() { - return element(by.buttonText('LOGIN')); - } - - getLoginPageTitle() { - return element(by.css('app-login h2')).getText(); - } - - getAcceptCookieButton() { - return element(by.buttonText('ACCEPT')); - } - - getUnibasLogo() { - return element(by.css('img[src="/assets/images/logo-unibas.jpg"]')); - } - - getUnibasWebsite() { - return element(by.css('img[title="Universität Basel"]')).getText(); - } - - getProjects() { - return element.all( - by.css('section.projects app-grid.project-list .app-grid-item') - ); - } - - getBEOLProjectTitle() { - const BEOLproject = this.getProjects().get(1); - return BEOLproject.element(by.css('h3')); - } - - getReadMoreBtnOfBEOL() { - const BEOLproject = this.getProjects().get(1); - return BEOLproject.element(by.buttonText('Read more')); - } - - getBEOLProjectPageTitle() { - return element(by.css('app-project h2')).getText(); - } -} diff --git a/apps/dsp-app-e2e/src/page-objects/footer.po.ts b/apps/dsp-app-e2e/src/page-objects/footer.po.ts deleted file mode 100644 index 9cf28337ec..0000000000 --- a/apps/dsp-app-e2e/src/page-objects/footer.po.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { browser, element, by } from 'protractor'; - -export class FooterPage { - navigateTo() { - return browser.get('/'); - } - - getFooterText() { - return element(by.css('div.about p')).getText(); - } - - getAngularLink() { - return element(by.css('a[href*="https://angular.io"]')); - } - - getMaterialLink() { - return element(by.css('a[href*="https://material.angular.io"]')); - } - - getKnoraLink() { - return element(by.css('a[href*="https://github.com/dasch-swiss/dsp-api/"]')); - } - - getSipiLink() { - return element(by.css('a[href*="https://sipi.io"]')); - } - - getSAGWLink() { - return element(by.css('a[href*="http://sagw.ch"]')); - } - - getSwissUniversitiesLink() { - return element(by.css('a[href*="http://swissuniversities.ch"]')); - } - - getSNFLink() { - return element(by.css('a[href*="http://snf.ch"]')); - } - - getDaSCHLink() { - return element(by.css('a[href*="https://dasch.swiss"]')); - } - - getDaSCHgitHubLink() { - return element(by.css('a[href*="https://www.github.com/dasch-swiss"]')); - } - - getTwitterLink() { - return element(by.css('a[href*="https://twitter.com/DaSCHSwiss"]')); - } - - getFacebookLink() { - return element(by.css('a[href*="https://facebook.com/dasch.swiss"]')); - } - - getBernoulistrasseMapLink() { - return element( - by.css( - 'a[href*="https://www.google.com/maps/place/Bernoullistrasse+32%2C+4056+Basel"]' - ) - ); - } -} diff --git a/apps/dsp-app-e2e/src/page-objects/help.po.ts b/apps/dsp-app-e2e/src/page-objects/help.po.ts deleted file mode 100644 index b01903c8e5..0000000000 --- a/apps/dsp-app-e2e/src/page-objects/help.po.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { browser, by, element } from 'protractor'; - -export class HelpPage { - navigateTo() { - return browser.get('/help'); - } - - getPageTitle() { - return element(by.css('app-help h1')).getText(); - } - - getProjManagementDocButton() { - const appGridDocEl = element.all( - by.css('#app-grid-documentation .app-grid-item') - ); - const projManagementEl = appGridDocEl.get(0); - - return projManagementEl.element(by.css('.action .mat-button')); - } - - getKnoraAppReleaseNotesButton() { - const appGridEl = element.all(by.css('#app-grid-tools .app-grid-item')); - const knoraAppEl = appGridEl.get(0); - - return knoraAppEl.element(by.css('.action .mat-button')); - } - - getSipiReleaseNotesButton() { - const appGridEl = element.all(by.css('#app-grid-tools .app-grid-item')); - const sipiEl = appGridEl.get(2); - - return sipiEl.element(by.css('.action .mat-button')); - } - - getDaschContactButton() { - const appGridEl = element.all(by.css('#app-grid-tools .app-grid-item')); - const daschContactEl = appGridEl.get(3); - - return daschContactEl.element(by.css('.action .mat-button')); - } - - getDaschSwissButton() { - const appGridEl = element.all(by.css('#app-grid-tools .app-grid-item')); - const daschSwissEl = appGridEl.get(4); - - return daschSwissEl.element(by.css('.action .mat-button')); - } - - getGithubContributeButton() { - const appGridEl = element.all(by.css('#app-grid-tools .app-grid-item')); - const githubEl = appGridEl.get(5); - - return githubEl.element(by.css('.action .mat-button')); - } -} diff --git a/apps/dsp-app-e2e/src/page-objects/login.po.ts b/apps/dsp-app-e2e/src/page-objects/login.po.ts deleted file mode 100644 index c0a1fcb800..0000000000 --- a/apps/dsp-app-e2e/src/page-objects/login.po.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { browser, by, element } from 'protractor'; - -export class LoginPage { - navigateToLogin() { - return browser.get('/login'); - } - - navigateToDashboard() { - return browser.driver.get('/dashboard'); - } - - getPageTitle() { - return element(by.css('app-login h2')).getText(); - } - - getDashboardTitle() { - return element(by.css('app-dashboard h1')).getText(); - } - - getUsername() { - return element(by.css('input[formControlName=username]')); - } - - getPassword() { - return element(by.css('input[formControlName=password]')); - } - - getLoginButton() { - return element(by.css('dsp-login-form form button')); - } -} diff --git a/apps/dsp-app-e2e/tsconfig.e2e.json b/apps/dsp-app-e2e/tsconfig.e2e.json deleted file mode 100644 index ba056d3557..0000000000 --- a/apps/dsp-app-e2e/tsconfig.e2e.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "../out-tsc/app", - "module": "commonjs", - "target": "es5", - "types": ["jasmine", "jasminewd2", "node"] - } -} diff --git a/apps/dsp-app-e2e/tsconfig.json b/apps/dsp-app-e2e/tsconfig.json new file mode 100644 index 0000000000..20c1c8b8aa --- /dev/null +++ b/apps/dsp-app-e2e/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["**/*.ts"], + "exclude": [], + "compilerOptions": { + "sourceMap": false, + "types": ["cypress"] + } +} diff --git a/apps/dsp-app/src/app/project/description/description.component.html b/apps/dsp-app/src/app/project/description/description.component.html index 8f4920a6ac..0efabeed28 100644 --- a/apps/dsp-app/src/app/project/description/description.component.html +++ b/apps/dsp-app/src/app/project/description/description.component.html @@ -40,7 +40,7 @@

-

{{project.longname}}

+

{{project.longname}}

diff --git a/apps/dsp-app/src/app/project/project-form/project-form.component.html b/apps/dsp-app/src/app/project/project-form/project-form.component.html index 18de480bc2..a89b53d071 100644 --- a/apps/dsp-app/src/app/project/project-form/project-form.component.html +++ b/apps/dsp-app/src/app/project/project-form/project-form.component.html @@ -119,7 +119,8 @@
-