graphdb-workbench-tests 3.1.1 → 3.1.2
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.
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {NotFoundSteps} from "../../steps/not-found/not-found-steps.js";
|
|
2
|
+
|
|
3
|
+
describe('Not found page', () => {
|
|
4
|
+
|
|
5
|
+
it('Should display the 404 not found page for an unknown route', () => {
|
|
6
|
+
// Given, I navigate to an unknown route
|
|
7
|
+
NotFoundSteps.visit('/unknown-route');
|
|
8
|
+
|
|
9
|
+
// Then, I expect to see the 404 not found page
|
|
10
|
+
NotFoundSteps.getNotFoundBanner().should('be.visible');
|
|
11
|
+
NotFoundSteps.getNotFoundContent().should('contain', '404 That’s an error!');
|
|
12
|
+
NotFoundSteps.getNotFoundContent().should('contain', 'The requested URL was not found on this server. That’s all I know.');
|
|
13
|
+
NotFoundSteps.getGoHomeButton().should('be.visible');
|
|
14
|
+
|
|
15
|
+
// When, I click on the "Go Home" button
|
|
16
|
+
NotFoundSteps.clickGoHomeButton();
|
|
17
|
+
|
|
18
|
+
// Then, I expect to be redirected to the home page
|
|
19
|
+
NotFoundSteps.getUrl().should('eq', `${Cypress.config('baseUrl')}/`);
|
|
20
|
+
// And the banner should no longer be visible
|
|
21
|
+
NotFoundSteps.getNotFoundBanner().should('not.exist');
|
|
22
|
+
});
|
|
23
|
+
});
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "3.1.
|
|
9
|
+
"version": "3.1.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
package/steps/base-steps.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {BaseSteps} from "../base-steps.js";
|
|
2
|
+
|
|
3
|
+
export class NotFoundSteps extends BaseSteps {
|
|
4
|
+
static visit(url) {
|
|
5
|
+
BaseSteps.visit(url);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static getNotFoundBanner() {
|
|
9
|
+
return cy.getByTestId('not-found-banner');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static getNotFoundContent() {
|
|
13
|
+
return this.getNotFoundBanner().invoke('text');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static getGoHomeButton() {
|
|
17
|
+
return this.getNotFoundBanner().find('a.btn.btn-primary');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static clickGoHomeButton() {
|
|
21
|
+
this.getGoHomeButton().click();
|
|
22
|
+
}
|
|
23
|
+
}
|