Skip to content

Commit 83e316b

Browse files
committed
Fix integration tests ([#78](#78))
1 parent 31c5e78 commit 83e316b

File tree

14 files changed

+1019
-3199
lines changed

14 files changed

+1019
-3199
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
### Fixed
9+
- [#78] Integration tests after upgrading CAS
10+
711
## [2.44.2-2]
812
### Added
913
- [#72] Configuration options for resource requirements

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ node('vagrant') {
121121
}
122122

123123
stage('e2e Tests') {
124-
ecoSystem.runCypressIntegrationTests([cypressImage: "cypress/included:8.6.0", enableVideo: true, enableScreenshots: true])
124+
ecoSystem.runCypressIntegrationTests([cypressImage: "cypress/included:12.17.1", enableVideo: true, enableScreenshots: true])
125125
}
126126

127127
stage('Push changes to remote repository') {

integrationTests/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
cypress/videos
3+
cypress/screenshots

integrationTests/cypress.config.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const doguTestLibrary = require('@cloudogu/dogu-integration-test-library');
2+
const { defineConfig } = require('cypress');
3+
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
4+
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
5+
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild");
6+
7+
async function setupNodeEvents(on, config) {
8+
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
9+
await preprocessor.addCucumberPreprocessorPlugin(on, config);
10+
11+
on(
12+
"file:preprocessor",
13+
createBundler({
14+
plugins: [createEsbuildPlugin.default(config)],
15+
})
16+
);
17+
18+
config = doguTestLibrary.configure(config);
19+
20+
return config;
21+
}
22+
23+
module.exports = defineConfig({
24+
e2e: {
25+
baseUrl: 'https://192.168.56.2',
26+
env: {
27+
"DoguName": "scm",
28+
"MaxLoginRetries": 3,
29+
"AdminUsername": "ces-admin",
30+
"AdminPassword": "ecosystem2016",
31+
"AdminGroup": "CesAdministrators"
32+
},
33+
videoCompression: false,
34+
specPattern: ["cypress/e2e/**/*.feature"],
35+
setupNodeEvents,
36+
},
37+
});

integrationTests/cypress.json

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,28 @@ Feature: Browser-based CAS login and logout functionality
1111
Scenario: logged out user can log in to the dogu
1212
Given the user is logged out of the CES
1313
When the user opens the dogu start page
14-
And the user types in correct login credentials
15-
And the user clicks the login button
14+
And the test user logs in with correct credentials
15+
And the user waits until the page is fully loaded
1616
Then the user is logged in to the dogu
1717

1818
@requires_testuser
1919
Scenario: logged out user can not log in to the dogu with wrong credentials
2020
Given the user is logged out of the CES
2121
When the user opens the dogu start page
22-
And the user types in wrong login credentials
23-
And the user clicks the login button
22+
And the user logs in with wrong credentials
2423
Then the login page informs the user about invalid credentials
2524

2625
@requires_testuser
2726
Scenario: logged in user can log out via logout button (front-channel)
2827
Given the user is logged into the CES
2928
When the user opens the dogu start page
29+
And the user waits until the page is fully loaded
3030
And the user clicks the dogu logout button
3131
Then the user is logged out of the dogu
3232

3333
@requires_testuser
3434
Scenario: logged in user can log out via cas logout page (back-channel)
3535
Given the user is logged into the CES
36-
When the user logs out by visiting the cas logout page
36+
When the user waits until the page is fully loaded
37+
And the user logs out by visiting the cas logout page
3738
Then the user is logged out of the dogu
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,35 @@ Feature: Automatic grant of privileges when logging into a dogu
55
Scenario: ces user with default privileges has default privileges in the dogu
66
Given the user is not member of the admin user group
77
When the user logs into the CES
8+
And the user waits until the page is fully loaded
89
Then the user has no administrator privileges in the dogu
910

1011
@requires_testuser
1112
Scenario: ces user with admin privileges has admin privileges in the dogu
1213
Given the user is member of the admin user group
1314
When the user logs into the CES
15+
And the user waits until the page is fully loaded
1416
Then the user has administrator privileges in the dogu
1517

1618
@requires_testuser
1719
Scenario: ces user without admin privileges has no admin privileges in the dogu
1820
Given the user is not member of the admin user group
1921
When the user logs into the CES
22+
And the user waits until the page is fully loaded
2023
Then the user has no administrator privileges in the dogu
2124

2225
@requires_testuser
2326
Scenario: internal dogu admin account is demoted after login of non admin
2427
Given the user has an internal default dogu account
2528
And the user is not member of the admin user group
2629
When the user logs into the CES
30+
And the user waits until the page is fully loaded
2731
Then the user has no administrator privileges in the dogu
2832

2933
@requires_testuser
3034
Scenario: internal dogu default account is promoted after login of admin
3135
Given the user has an internal default dogu account
3236
And the user is member of the admin user group
3337
When the user logs into the CES
38+
And the user waits until the page is fully loaded
3439
Then the user has administrator privileges in the dogu

integrationTests/cypress/integration/scm_browser.feature renamed to integrationTests/cypress/e2e/scm_browser.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Feature: SCM Browser
44
Scenario: ces admin user can access index
55
Given the user is member of the admin user group
66
When the user logs into the CES
7+
And the user waits until the page is fully loaded
78
Then the user can access the index

integrationTests/cypress/plugins/index.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

integrationTests/cypress/support/index.js renamed to integrationTests/cypress/support/e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ doguTestLibrary.registerCommands()
44

55
// local commands
66
import './commands/scm_api'
7-
import './commands/scm_ui'
7+
import './commands/scm_ui'

0 commit comments

Comments
 (0)