-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58c0d6b
commit 0273df4
Showing
8 changed files
with
323 additions
and
295 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
test-cypress/fixtures/cluster/save-cluster-configuration-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"electionMinTimeout": 5000, | ||
"electionRangeTimeout": 3000, | ||
"heartbeatInterval": 1500, | ||
"messageSizeKB": 64, | ||
"verificationTimeout": 1200, | ||
"transactionLogMaximumSizeGB": 50, | ||
"batchUpdateInterval": 2000, | ||
"nodes": ["pc-desktop:7300", "pc-desktop:7301", "pc-desktop:7302"] | ||
} |
277 changes: 0 additions & 277 deletions
277
test-cypress/integration/cluster/cluster-configuration.spec.js
This file was deleted.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
...ress/integration/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import {ClusterPageSteps} from "../../../steps/cluster/cluster-page-steps"; | ||
import {GlobalOperationsStatusesStub} from "../../../stubs/global-operations-statuses-stub"; | ||
import {ClusterStubs} from "../../../stubs/cluster/cluster-stubs"; | ||
import {RemoteLocationStubs} from "../../../stubs/cluster/remote-location-stubs"; | ||
import {ClusterConfigurationSteps} from "../../../steps/cluster/cluster-configuration-steps"; | ||
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps"; | ||
import {ApplicationSteps} from "../../../steps/application-steps"; | ||
|
||
describe('Cluster configuration', () => { | ||
let repositoryId; | ||
|
||
beforeEach(() => { | ||
repositoryId = 'cluster-repo' + Date.now(); | ||
GlobalOperationsStatusesStub.stubNoOperationsResponse(repositoryId); | ||
// Given there is an existing cluster created | ||
ClusterStubs.stubClusterConfig(); | ||
ClusterStubs.stubClusterGroupStatus(); | ||
ClusterStubs.stubClusterNodeStatus(); | ||
RemoteLocationStubs.stubRemoteLocationFilter(); | ||
RemoteLocationStubs.stubRemoteLocationStatusInCluster(); | ||
}); | ||
|
||
it('should be able to add and delete tags', () => { | ||
const tagName = 'test'; | ||
// Given I have opened the cluster management page | ||
ClusterPageSteps.visit(); | ||
// When I click on edit properties and open Multi-region tab | ||
ClusterPageSteps.previewClusterConfig(); | ||
ClusterConfigurationSteps.selectMultiRegionConfigTab(); | ||
// I expect to see | ||
ClusterConfigurationSteps.getMultiRegionHeader().should('contain.text', 'Primary cluster'); | ||
ClusterConfigurationSteps.getAddTagButton().should('be.visible').and('not.be.disabled'); | ||
ClusterConfigurationSteps.getEnableSecondaryModeButton().should('be.visible').and('be.enabled'); | ||
ClusterConfigurationSteps.getTagsTable().should('not.exist'); | ||
|
||
ClusterStubs.stubAddTag(tagName); | ||
ClusterConfigurationSteps.clickAddTagButton(); | ||
ClusterConfigurationSteps.typeTag(tagName); | ||
ClusterConfigurationSteps.clickSubmitTagButton(); | ||
cy.wait('@add-tag').then((interception) => { | ||
expect(interception.request.body).to.deep.equal({tag: tagName}); | ||
}); | ||
|
||
ClusterStubs.stubClusterGroupStatusWithTag(); | ||
cy.wait('@3-nodes-cluster-group-status-tag'); | ||
// Assert the tags table contains the expected tag | ||
ClusterConfigurationSteps.getTagsTable().should('be.visible'); | ||
ClusterConfigurationSteps.getTagsTableRows().should('contain.text', tagName); | ||
|
||
// And expect success message to be displayed. | ||
ApplicationSteps.getSuccessNotifications().contains(`Successfully added to cluster primary identifier tag: ${tagName}`); | ||
|
||
//When I delete the tag | ||
ClusterConfigurationSteps.clickDeleteTagButton(); | ||
// I expect to see deleting confirmation dialog. | ||
ModalDialogSteps.getDialogHeader().should('contain', `Delete identifier tag ${tagName}`); | ||
ModalDialogSteps.getDialogBody().should('contain', 'Deleting identifier tag would stop any secondary cluster identified with it from pulling updates.'); | ||
|
||
// When I confirm | ||
ClusterStubs.stubDeleteTag(tagName); | ||
ModalDialogSteps.clickOnConfirmButton(); | ||
cy.wait('@delete-tag').then((interception) => { | ||
expect(interception.request.body).to.deep.equal({tag: tagName}); | ||
}); | ||
}); | ||
|
||
it('should be able to switch modes', () => { | ||
ClusterStubs.stubEnableSecondaryMode(); | ||
const rpcAddress = 'node-name:7300'; | ||
const tag = 'us-central'; | ||
|
||
// Given I have opened the cluster management page | ||
ClusterPageSteps.visit(); | ||
// When I click on edit properties and open Nodes tab | ||
ClusterPageSteps.previewClusterConfig(); | ||
ClusterConfigurationSteps.selectMultiRegionConfigTab(); | ||
// I click enable secondary mode btn | ||
ClusterConfigurationSteps.clickEnableSecondaryModeButton(); | ||
// I expect to see enable secondary mode confirmation dialog. | ||
ModalDialogSteps.getDialogHeader().should('contain', `Enable secondary mode`); | ||
ModalDialogSteps.getDialogBody().should('contain', 'By enabling secondary mode this cluster would become a read-only replica of the specified primary cluster.'); | ||
// When I confirm I expect to see configuration modal | ||
ModalDialogSteps.getConfirmButton().click(); | ||
ModalDialogSteps.getDialogHeader().should('contain', `Secondary cluster settings`); | ||
ClusterConfigurationSteps.getEnableButton().should('be.disabled'); | ||
ClusterConfigurationSteps.typeRpcAddress(rpcAddress); | ||
ClusterConfigurationSteps.getEnableButton().should('be.disabled'); | ||
ClusterConfigurationSteps.typePrimaryTag(tag); | ||
ClusterConfigurationSteps.getEnableButton().should('not.be.disabled'); | ||
ClusterConfigurationSteps.clickEnableButton(); | ||
cy.wait('@enable-secondary-mode').then((interception) => { | ||
expect(interception.request.body).to.deep.equal({primaryNode: rpcAddress, tag}); | ||
}); | ||
// And expect success message to be displayed. | ||
ApplicationSteps.getSuccessNotifications().contains(`Successfully enabled secondary mode`); | ||
}); | ||
}); |
Oops, something went wrong.