-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: [PROD-13567] cypress tests for disabled display of results
- Loading branch information
Showing
5 changed files
with
86 additions
and
5 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
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
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
60 changes: 60 additions & 0 deletions
60
cypress/e2e/brewery/ResultsDashboards-DisplayDisabled.cy.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,60 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
import { Login, ScenarioParameters, Scenarios } from '../../commons/actions'; | ||
import { GENERIC_SELECTORS } from '../../commons/constants/generic/IdConstants'; | ||
import { stub } from '../../commons/services/stubbing'; | ||
import { routeUtils as route } from '../../commons/utils'; | ||
import { | ||
WORKSPACE_LIST_WITHOUT_DASHBOARDS, | ||
WORKSPACE_WITHOUT_DASHBOARDS, | ||
} from '../../fixtures/stubbing/ScenarioViewDashboard/workspace'; | ||
import { DEFAULT_SCENARIOS_LIST } from '../../fixtures/stubbing/default'; | ||
|
||
const { id: scenarioId } = DEFAULT_SCENARIOS_LIST[0]; | ||
const runOptions = { | ||
runDuration: 1000, | ||
dataIngestionDuration: 1000, | ||
finalStatus: 'Successful', | ||
expectedPollsCount: 2, | ||
}; | ||
|
||
describe('results display is disabled', () => { | ||
before(() => { | ||
stub.start(); | ||
stub.setWorkspaces(WORKSPACE_LIST_WITHOUT_DASHBOARDS); | ||
}); | ||
|
||
beforeEach(() => { | ||
Login.login({ | ||
url: `/${WORKSPACE_WITHOUT_DASHBOARDS.id}`, | ||
workspaceId: WORKSPACE_WITHOUT_DASHBOARDS.id, | ||
isPowerBiEnabled: false, | ||
}); | ||
}); | ||
|
||
after(() => { | ||
stub.stop(); | ||
}); | ||
|
||
it('can launch a scenario and show Display of results is disabled dashboard', () => { | ||
cy.get(GENERIC_SELECTORS.dashboards.tabName).should('not.exist'); | ||
ScenarioParameters.launch({ scenarioId, runOptions, saveAndLaunch: true }); | ||
ScenarioParameters.waitForScenarioRunEnd(); | ||
Scenarios.getDashboardAccordionLogsDownloadButton().should('be.visible'); | ||
Scenarios.getDashboardAccordion().click(); | ||
Scenarios.getDashboardPlaceholder().should('be.visible'); | ||
Scenarios.getDashboardPlaceholder().should( | ||
'have.text', | ||
'Scenario run was successful but the display of results is disabled' | ||
); | ||
}); | ||
it('can redirect from dashboards to workspace view when results display is disabled', () => { | ||
route.browse({ | ||
url: `${WORKSPACE_WITHOUT_DASHBOARDS.id}/dashboards`, | ||
workspaceId: WORKSPACE_WITHOUT_DASHBOARDS.id, | ||
expectedURL: `${WORKSPACE_WITHOUT_DASHBOARDS.id}/scenario/s-stubbedscnr01`, | ||
isPowerBiEnabled: false, | ||
}); | ||
cy.get(GENERIC_SELECTORS.dashboards.tabName).should('not.exist'); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
cypress/fixtures/stubbing/ScenarioViewDashboard/workspace.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,16 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
import { WORKSPACE_EXAMPLE } from '../default'; | ||
|
||
export const WORKSPACE_WITHOUT_DASHBOARDS = { | ||
...WORKSPACE_EXAMPLE, | ||
id: 'w-stbwrknodsh', | ||
key: 'breweryNoDashboards', | ||
webApp: { | ||
url: null, | ||
iframes: null, | ||
options: null, | ||
}, | ||
}; | ||
|
||
export const WORKSPACE_LIST_WITHOUT_DASHBOARDS = [WORKSPACE_EXAMPLE, WORKSPACE_WITHOUT_DASHBOARDS]; |