graphdb-workbench-tests 4.0.0-TR24 → 4.0.0-TR25

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,6 +1,8 @@
1
1
  import HomeSteps from "../../../steps/home-steps";
2
2
  import {MainMenuSteps} from "../../../steps/main-menu-steps";
3
3
  import {QueriesAndUpdatesSteps} from "../../../steps/monitoring/queries-and-updates-steps";
4
+ import {ApplicationSteps} from "../../../steps/application-steps";
5
+ import {QueriesAndUpdatesStubs} from "../../../stubs/monitoring/queries-and-updates-stubs";
4
6
 
5
7
  describe('Queries and Updates with selected repository', () => {
6
8
  let repositoryId;
@@ -30,6 +32,20 @@ describe('Queries and Updates with selected repository', () => {
30
32
  verifyInitialStateWithSelectedRepository();
31
33
  });
32
34
 
35
+ it('should not allow aborting an update while it is replicated to the cluster', () => {
36
+ // Given an update is being replicated to the cluster
37
+ QueriesAndUpdatesStubs.stubGetActiveQueries(repositoryId, '/monitoring/get-active-queries-cluster-replicating.json');
38
+ // When I open the Queries and Updates page
39
+ QueriesAndUpdatesSteps.visit();
40
+ cy.wait('@getActiveQueries');
41
+
42
+ // Then I expect Abort to be disabled
43
+ QueriesAndUpdatesSteps.getAbortButtons().eq(0).should('be.disabled');
44
+ // And its popover to say why
45
+ QueriesAndUpdatesSteps.hoverAbortButton(0);
46
+ ApplicationSteps.getPopover().should('contain.text', 'Update cannot be aborted while being replicated to the cluster');
47
+ });
48
+
33
49
  const verifyInitialStateWithSelectedRepository = () => {
34
50
  QueriesAndUpdatesSteps.getQueryAndUpdatePage().should('be.visible');
35
51
  QueriesAndUpdatesSteps.getPauseButton().should('be.visible');
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "trackId": "42",
4
+ "trackAlias": "",
5
+ "username": "admin",
6
+ "node": "http://localhost:7200/repositories/cluster-repository#42",
7
+ "isRequestedToStop": false,
8
+ "sparqlString": "INSERT DATA { <urn:a> <urn:b> <urn:c> }",
9
+ "state": "FOLLOWER_COMMIT",
10
+ "type": "UPDATE",
11
+ "numberOfOperations": 3,
12
+ "msSinceCreated": 1200,
13
+ "humanLifetime": "1s"
14
+ }
15
+ ]
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR24",
3
+ "version": "4.0.0-TR25",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "4.0.0-TR24",
9
+ "version": "4.0.0-TR25",
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": "4.0.0-TR24",
3
+ "version": "4.0.0-TR25",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -23,6 +23,10 @@ export class ApplicationSteps {
23
23
  return this.getNotifications().filter('.toast-warning');
24
24
  }
25
25
 
26
+ static getPopover() {
27
+ return cy.get('.popover');
28
+ }
29
+
26
30
  // navigation via main menu
27
31
  static openImportPage() {
28
32
  cy.get('onto-navbar .menu-element').eq(0).click();
@@ -14,6 +14,15 @@ export class QueriesAndUpdatesSteps extends BaseSteps {
14
14
  return this.getQueryAndUpdatePage().getByTestId('pause-button');
15
15
  }
16
16
 
17
+ static getAbortButtons() {
18
+ return this.getQueryAndUpdatePage().getByTestId('monitoring-queries-abort-button');
19
+ }
20
+
21
+ // A real hover: the popover's jQuery mouseenter handler ignores a synthetic mouseenter.
22
+ static hoverAbortButton(index) {
23
+ this.getQueryAndUpdatePage().getByTestId('monitoring-queries-abort-popover-trigger').eq(index).realHover();
24
+ }
25
+
17
26
  static getNoRunningQueriesOrUpdates() {
18
27
  return this.getQueryAndUpdatePage().getByTestId('no-running-queries-or-updates-alert');
19
28
  }
@@ -0,0 +1,5 @@
1
+ export class QueriesAndUpdatesStubs {
2
+ static stubGetActiveQueries(repositoryId, fixture) {
3
+ cy.intercept({method: 'GET', pathname: `/rest/monitor/repository/${repositoryId}/query/active`}, {fixture}).as('getActiveQueries');
4
+ }
5
+ }