-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comprehensive dashboard a11y tests #57821
Closed
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d81a0fc
adding comprehensive dashboard tests
bhavyarm 45715b0
Merge branch 'master' into a11y2Dashboard
bhavyarm 056fb5a
fixing delete and adding dima changes
bhavyarm cab78c9
addressing review comments
bhavyarm 47980f9
Merge branch 'master' into a11y2Dashboard
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,27 +20,36 @@ | |
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['common', 'dashboard', 'header']); | ||
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'home', 'settings']); | ||
const a11y = getService('a11y'); | ||
const esArchiver = getService('esArchiver'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const dashboardPanelActions = getService('dashboardPanelActions'); | ||
const dashboardAddPanel = getService('dashboardAddPanel'); | ||
const testSubjects = getService('testSubjects'); | ||
const find = getService('find'); | ||
const listingTable = getService('listingTable'); | ||
|
||
describe('Dashboard', () => { | ||
const dashboardName = 'Dashboard Listing A11y'; | ||
const clonedDashboardName = 'Dashboard Listing A11y Copy'; | ||
|
||
before(async () => { | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
await kibanaServer.uiSettings.update({ | ||
defaultIndex: 'logstash-*', | ||
}); | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
// await esArchiver.loadIfNeeded('logstash_functional'); | ||
// await kibanaServer.uiSettings.update({ | ||
// defaultIndex: 'logstash-*', | ||
// }); | ||
await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); | ||
await PageObjects.home.addSampleDataSet('flights'); | ||
}); | ||
|
||
it('dashboard', async () => { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('create dashboard button', async () => { | ||
await PageObjects.dashboard.clickCreateDashboardPrompt(); | ||
await PageObjects.dashboard.clickNewDashboard(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
|
@@ -49,9 +58,115 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { | |
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Open Edit mode', async () => { | ||
await PageObjects.dashboard.switchToEditMode(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Open add panel', async () => { | ||
await dashboardAddPanel.clickOpenAddPanel(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('add a visualization', async () => { | ||
await testSubjects.click('savedObjectTitle[Flights]-Delay-Buckets'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('add a saved search', async () => { | ||
await dashboardAddPanel.addSavedSearch('[Flights] Flight Log'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('save the dashboard', async () => { | ||
await PageObjects.dashboard.saveDashboard(dashboardName); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Open Edit mode', async () => { | ||
await PageObjects.dashboard.switchToEditMode(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('open options menu', async () => { | ||
await PageObjects.dashboard.openOptions(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Should be able to hide panel titles', async () => { | ||
await testSubjects.click('dashboardPanelTitlesCheckbox'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Should be able display panels without margins', async () => { | ||
await testSubjects.click('dashboardMarginsCheckbox'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Open add panel', async () => { | ||
await dashboardAddPanel.clickOpenAddPanel(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Add one more saved object to cancel it', async () => { | ||
await testSubjects.click('savedObjectTitle[Flights]-Average-Ticket-Price'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Close add panel', async () => { | ||
await dashboardAddPanel.closeAddPanel(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Exit out of edit mode', async () => { | ||
await PageObjects.dashboard.clickCancelOutOfEditMode(dashboardName); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Discard changes', async () => { | ||
await PageObjects.common.clickConfirmOnModal(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Test full screen', async () => { | ||
await PageObjects.dashboard.clickFullScreenMode(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Exit out of full screen mode', async () => { | ||
const logoButton = await PageObjects.dashboard.getExitFullScreenLogoButton(); | ||
await logoButton.moveMouseTo(); | ||
await PageObjects.dashboard.clickExitFullScreenTextButton(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have seen the same 3 lines of code in one of the
If you agree, please update the other test as well |
||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Make a clone of the dashboard', async () => { | ||
await PageObjects.dashboard.clickClone(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Confirm clone with *copy* appended', async () => { | ||
await PageObjects.dashboard.confirmClone(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Dashboard listing table', async () => { | ||
await PageObjects.dashboard.gotoDashboardLandingPage(); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
|
||
it('Delete a11y clone dashboard', async () => { | ||
await listingTable.searchForItemWithName(clonedDashboardName); | ||
await listingTable.checkListingSelectAllCheckbox(); | ||
await listingTable.clickDeleteSelected(); | ||
await a11y.testAppSnapshot(); | ||
await PageObjects.common.clickConfirmOnModal(); | ||
await listingTable.searchForItemWithName(''); | ||
}); | ||
|
||
it('Open flight dashboard', async () => { | ||
await testSubjects.click('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard'); | ||
await a11y.testAppSnapshot(); | ||
}); | ||
}); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier round of phase 1 tests used logstash data. I removed it and using sample data. Removed the commented out lines. Thanks @majagrubic