@scm-manager/e2e-tests 2.31.2-20220124-083441 → 2.31.2-20220128-144434

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,16 +22,32 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- When("User visits repository", function() {
26
- cy.visit(`/repo/${this.repository.namespace}/${this.repository.name}/code/sources`);
27
- });
25
+ import { hri } from "human-readable-ids";
28
26
 
29
- When("User performs file search inside repository", function() {
30
- cy.byTestId("file_search_button").click();
31
- cy.url().should("include", `/repo/${this.repository.namespace}/${this.repository.name}/code/search/main?q=`);
32
- cy.get("[data-testid=file_search_filter_input]").type("README");
33
- });
27
+ describe("Anonymous Mode Disabled", () => {
28
+ beforeEach(() => {
29
+ cy.restSetAnonymousMode("OFF");
30
+ });
31
+
32
+ it("should show login page when not authenticated", () => {
33
+ // Act
34
+ cy.visit("/repos/");
35
+
36
+ // Assert
37
+ cy.byTestId("login-button");
38
+ });
39
+
40
+ it("should show footer for authenticated user", () => {
41
+ // Arrange
42
+ const username = hri.random();
43
+ const password = hri.random();
44
+ cy.restCreateUser(username, password);
45
+ cy.restLogin(username, password);
46
+
47
+ // Act
48
+ cy.visit("/home");
34
49
 
35
- Then("The search results are found", function() {
36
- cy.get("[data-testid=file_search_single_result]").contains("README.md");
50
+ // Assert
51
+ cy.byTestId("footer-user-profile");
52
+ });
37
53
  });
@@ -0,0 +1,76 @@
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { hri } from "human-readable-ids";
26
+
27
+ describe("Anonymous Mode Full", () => {
28
+ beforeEach(() => {
29
+ cy.restSetAnonymousMode("FULL");
30
+ });
31
+
32
+ it("should show login button on anonymous route", () => {
33
+ // Arrange
34
+ cy.restSetUserPermissions("_anonymous", ["repository:read,pull:*"]);
35
+ // Act
36
+ cy.visit("/repos/");
37
+ // Assert
38
+ cy.byTestId("repository-overview-filter");
39
+ cy.byTestId("primary-navigation-login");
40
+ });
41
+
42
+ it("should show login page", () => {
43
+ // Act
44
+ cy.visit("/login/");
45
+ // Assert
46
+ cy.byTestId("login-button");
47
+ });
48
+
49
+ it("should navigate to login page", () => {
50
+ // Act
51
+ cy.byTestId("login-button").click();
52
+ // Assert
53
+ cy.byTestId("login-button");
54
+ });
55
+
56
+ it("should redirect to repositories overview after login", () => {
57
+ // Arrange
58
+ const username = hri.random();
59
+ const password = hri.random();
60
+ cy.restCreateUser(username, password);
61
+
62
+ // Act
63
+ cy.login(username, password);
64
+
65
+ // Assert
66
+ cy.byTestId(username);
67
+ });
68
+
69
+ it("should not allow anonymous user to change password", () => {
70
+ // Act
71
+ cy.visit("/me/settings/");
72
+ // Assert
73
+ cy.containsNotByTestId("ul", "user-settings-link");
74
+ cy.get("section").not("Change password");
75
+ });
76
+ });
@@ -0,0 +1,61 @@
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ /*
26
+ * MIT License
27
+ *
28
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
29
+ *
30
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ * of this software and associated documentation files (the "Software"), to deal
32
+ * in the Software without restriction, including without limitation the rights
33
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ * copies of the Software, and to permit persons to whom the Software is
35
+ * furnished to do so, subject to the following conditions:
36
+ *
37
+ * The above copyright notice and this permission notice shall be included in all
38
+ * copies or substantial portions of the Software.
39
+ *
40
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ * SOFTWARE.
47
+ */
48
+
49
+ describe("Anonymous Mode with Protocol Only", () => {
50
+ beforeEach(() => {
51
+ cy.restSetAnonymousMode("PROTOCOL_ONLY");
52
+ });
53
+
54
+ it("should show login page when not authenticated", () => {
55
+ // Act
56
+ cy.visit("/repos/");
57
+
58
+ // Assert
59
+ cy.byTestId("login-button");
60
+ });
61
+ });
@@ -22,4 +22,38 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- export * from "@scm-manager/integration-test-runner/steps";
25
+ import { hri } from "human-readable-ids";
26
+
27
+ describe("Repository File Search", () => {
28
+ let username: string;
29
+ let password: string;
30
+ let namespace: string;
31
+ let name: string;
32
+
33
+ beforeEach(() => {
34
+ // Create user and login
35
+ username = hri.random();
36
+ password = hri.random();
37
+ cy.restCreateUser(username, password);
38
+ cy.restLogin(username, password);
39
+
40
+ // Create repo
41
+ namespace = hri.random();
42
+ name = hri.random();
43
+ cy.restCreateRepo("git", namespace, name, true);
44
+ });
45
+
46
+ it("should search file inside repository", () => {
47
+ // Arrange
48
+ cy.restSetUserRepositoryRole(username, namespace, name, "WRITE");
49
+
50
+ // Act
51
+ cy.visit(`/repo/${namespace}/${name}/code/sources`);
52
+ cy.byTestId("file_search_button").click();
53
+ cy.url().should("include", `/repo/${namespace}/${name}/code/search/main?q=`);
54
+ cy.byTestId("file_search_filter_input").type("README");
55
+
56
+ // Assert
57
+ cy.byTestId("file_search_single_result").contains("README.md");
58
+ });
59
+ });
@@ -22,4 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- module.exports = require("@scm-manager/integration-test-runner/plugins");
25
+ // This file was generated, please DO NOT EDIT THIS FILE!
26
+ import register from "@scm-manager/integration-test-runner/plugins";
27
+ export default register;
File without changes
@@ -21,5 +21,7 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
+
25
+ // This file was generated, please DO NOT EDIT THIS FILE
24
26
  import "@scm-manager/integration-test-runner/commands";
25
27
  import "./commands";
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "noEmit": true,
4
+ "target": "es5",
5
+ "lib": ["es5", "dom"],
6
+ "types": ["cypress"]
7
+ },
8
+ "include": ["**/*.ts"]
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/e2e-tests",
3
- "version": "2.31.2-20220124-083441",
3
+ "version": "2.31.2-20220128-144434",
4
4
  "description": "End to end Tests for SCM-Manager",
5
5
  "main": "index.js",
6
6
  "author": "Eduard Heimbuch <eduard.heimbuch@cloudogu.com>",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@ffmpeg-installer/ffmpeg": "^1.0.20",
15
- "@scm-manager/integration-test-runner": "^1.3.7",
15
+ "@scm-manager/integration-test-runner": "^3.0.0",
16
16
  "fluent-ffmpeg": "^2.1.2"
17
17
  },
18
18
  "prettier": "@scm-manager/prettier-config",
@@ -1,38 +0,0 @@
1
- #
2
- # MIT License
3
- #
4
- # Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- #
24
-
25
- Feature: Anonymous Mode Disabled
26
-
27
- Background:
28
- Given Anonymous Mode is disabled
29
-
30
- Scenario: There is no primary navigation
31
- Given User is not authenticated
32
- When User visits any page
33
- Then There is no primary navigation
34
-
35
- Scenario: Authenticated users have a footer navigation
36
- Given User is authenticated
37
- When User visits any page
38
- Then There is a footer navigation
@@ -1,51 +0,0 @@
1
- #
2
- # MIT License
3
- #
4
- # Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- #
24
-
25
- Feature: Anonymous Mode Full
26
-
27
- Background:
28
- Given Full Anonymous Mode is enabled
29
- And User is not authenticated
30
-
31
- Scenario: Show login button on anonymous route
32
- Given Anonymous user has permission to read all repositories
33
- When User visits the repository overview page
34
- Then The repository overview page is shown
35
- And There is a login button
36
-
37
- Scenario: Show login page
38
- When User visits login page
39
- Then The login page is shown
40
-
41
- Scenario: Navigate to login page
42
- When Users clicks login button
43
- Then The login page is shown
44
-
45
- Scenario: Redirect to repositories overview after login
46
- When User logs in
47
- Then User should be authenticated
48
-
49
- Scenario: Anonymous user cannot change password
50
- When User visits their user settings
51
- Then There is no option to change the password
@@ -1,32 +0,0 @@
1
- #
2
- # MIT License
3
- #
4
- # Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- #
24
-
25
- Feature: Anonymous Mode with Protocol Only
26
- Background:
27
- Given Protocol Only Anonymous Mode is enabled
28
-
29
- Scenario: There is no primary navigation
30
- Given User is not authenticated
31
- When User visits the repository overview page
32
- Then The login page is shown
@@ -1,35 +0,0 @@
1
- #
2
- # MIT License
3
- #
4
- # Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- #
24
-
25
- Feature: Repository File Search
26
-
27
- Background:
28
- Given User is authenticated
29
- And A git repository exists
30
-
31
- Scenario: Search file inside repository
32
- Given User has permission to read and write repository
33
- When User visits repository
34
- And User performs file search inside repository
35
- Then The search results are found