-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for shared links when multi-tenancy is enabled
Signed-off-by: Craig Perkins <cwperx@amazon.com>
- Loading branch information
1 parent
34ba5be
commit 254cd39
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
cypress/integration/plugins/security-dashboards-plugin/multitenancy_shared_links.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,55 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { STACK_MANAGEMENT_PATH } from '../../../utils/dashboards/constants'; | ||
|
||
import { switchTenantTo } from './switch_tenant'; | ||
import 'cypress-real-events/support'; | ||
|
||
Cypress.automation('remote:debugger:protocol', { | ||
command: 'Browser.grantPermissions', | ||
params: { | ||
permissions: ['clipboardReadWrite', 'clipboardSanitizedWrite'], | ||
origin: window.location.origin, | ||
}, | ||
}); | ||
|
||
if (Cypress.env('SECURITY_ENABLED')) { | ||
describe('Multi Tenancy Tests for Shared Links: ', () => { | ||
it('Tests to ensure that copy link includes security tenant as url param', () => { | ||
cy.visit(STACK_MANAGEMENT_PATH); | ||
cy.waitForLoader(); | ||
switchTenantTo('private'); | ||
cy.getElementByTestId('toggleNavButton').click(); | ||
cy.get('span[title="Discover"]').click(); | ||
cy.getElementByTestId('shareTopNavButton').click(); | ||
cy.getElementByTestId('copyShareUrlButton') | ||
.realClick() | ||
.then(() => { | ||
cy.window() | ||
.its('navigator.clipboard') | ||
.then((clip) => clip.readText()) | ||
.should('contain', 'security_tenant='); | ||
}); | ||
}); | ||
it('Tests to ensure that copy link includes security tenant as url param in short url', () => { | ||
cy.visit(STACK_MANAGEMENT_PATH); | ||
cy.waitForLoader(); | ||
switchTenantTo('private'); | ||
cy.getElementByTestId('toggleNavButton').click(); | ||
cy.get('span[title="Discover"]').click(); | ||
cy.getElementByTestId('shareTopNavButton').click(); | ||
cy.getElementByTestId('createShortUrl').click(); | ||
cy.getElementByTestId('copyShareUrlButton') | ||
.realClick() | ||
.then(() => { | ||
cy.window() | ||
.its('navigator.clipboard') | ||
.then((clip) => clip.readText()) | ||
.should('contain', 'security_tenant='); | ||
}); | ||
}); | ||
}); | ||
} |
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