graphdb-workbench-tests 3.1.0 → 3.1.1-RC1

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.
@@ -1,7 +1,6 @@
1
1
  import HomeSteps from '../../steps/home-steps';
2
2
  import {EnvironmentStubs} from "../../stubs/environment-stubs";
3
3
  import {MainMenuSteps} from "../../steps/main-menu-steps";
4
- import {BrowserStubs} from "../../stubs/browser-stubs";
5
4
 
6
5
  describe('Documentation links resolver', () => {
7
6
 
@@ -12,50 +11,31 @@ describe('Documentation links resolver', () => {
12
11
 
13
12
  it('Should link to master version when in dev mode', () => {
14
13
  HomeSteps.visitInDevMode();
15
- waitForProductInfo();
16
- BrowserStubs.stubWindowOpen();
17
14
  MainMenuSteps.clickOnMenuHelp();
18
15
  // Assert that links point to the master version
19
- assertDocumentationLinks('master');
20
-
16
+ MainMenuSteps.getSubMenuButtonByName('Documentation').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/index.html');
17
+ MainMenuSteps.getSubMenuButtonByName('Tutorials').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/tutorials.html');
18
+ MainMenuSteps.getSubMenuButtonByName('Support').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/support.html');
21
19
  });
22
20
 
23
21
  it('Should link to master version when in prod mode and unofficial version', () => {
24
22
  EnvironmentStubs.stubProductInfo('10.8-TR1-test');
25
23
  HomeSteps.visitInProdMode();
26
- waitForProductInfo();
27
- BrowserStubs.stubWindowOpen();
28
24
  MainMenuSteps.clickOnMenuHelp();
29
25
  // Assert that links point to the master version
30
- assertDocumentationLinks('master');
26
+ MainMenuSteps.getSubMenuButtonByName('Documentation').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/index.html');
27
+ MainMenuSteps.getSubMenuButtonByName('Tutorials').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/tutorials.html');
28
+ MainMenuSteps.getSubMenuButtonByName('Support').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/master/support.html');
31
29
  });
32
30
 
33
31
  it('Should link to GDB version when in prod mode and official version', () => {
34
32
  EnvironmentStubs.stubProductInfo('10.8');
35
33
  HomeSteps.visitInProdMode();
36
- waitForProductInfo();
37
- BrowserStubs.stubWindowOpen();
38
34
  MainMenuSteps.clickOnMenuHelp();
39
35
  // Assert that links point to the specific GDB version
40
- assertDocumentationLinks('10.8');
36
+ MainMenuSteps.getSubMenuButtonByName('Documentation').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/10.8/index.html');
37
+ MainMenuSteps.getSubMenuButtonByName('Tutorials').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/10.8/tutorials.html');
38
+ MainMenuSteps.getSubMenuButtonByName('Support').should('have.attr', 'href').and('include', 'https://graphdb.ontotext.com/documentation/10.8/support.html');
41
39
  });
42
40
  });
43
41
 
44
- function waitForProductInfo() {
45
- // We must wait for both requests, old legacy one and the new from the API
46
- cy.wait(EnvironmentStubs.PRODUCT_INFO_ALIAS());
47
- cy.wait(EnvironmentStubs.PRODUCT_INFO_ALIAS());
48
- }
49
-
50
- function assertDocumentationLinks(version) {
51
- const baseUrl = `https://graphdb.ontotext.com/documentation/${version}`;
52
-
53
- MainMenuSteps.clickOnSubMenu('Documentation')
54
- cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `${baseUrl}/index.html`, "_blank")
55
-
56
- MainMenuSteps.clickOnSubMenu('Tutorials')
57
- cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `${baseUrl}/tutorials.html`, "_blank")
58
-
59
- MainMenuSteps.clickOnSubMenu('Support')
60
- cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', `${baseUrl}/support.html`, "_blank")
61
- }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.1.0",
3
+ "version": "3.1.1-RC1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.1.0",
9
+ "version": "3.1.1-RC1",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@bahmutov/cypress-code-coverage": "^2.7.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.1.0",
3
+ "version": "3.1.1-RC1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
@@ -13,7 +13,7 @@ export class MainMenuSteps {
13
13
  }
14
14
 
15
15
  static getSubMenuButtonByName(menuName) {
16
- return MainMenuSteps.getMainMenu().find('.sub-menu-link').contains(menuName);
16
+ return MainMenuSteps.getMainMenu().find('.sub-menu-link').contains(menuName).closest('.sub-menu-link');
17
17
  }
18
18
 
19
19
  static getMenuImport() {
@@ -58,7 +58,7 @@ export class MainMenuSteps {
58
58
  // Forced it because some element as "Explore" for example has CSS pointer-events: none
59
59
  MainMenuSteps.getMenuButton(menuName).click({force: true});
60
60
  }
61
-
61
+
62
62
  static clickOnSubmenuTriggerElement(menuName) {
63
63
  MainMenuSteps.getMainMenu().find('.menu-element-root').contains(menuName).parent().click();
64
64
  }