Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files * Update eslint plugin * updated files
This commit is contained in:
@@ -14,14 +14,9 @@ export const smokeTestScenario = {
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().should('be.visible').click();
|
||||
|
||||
cy.contains('CSV Metric Values')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
||||
});
|
||||
|
||||
// Make sure the graph renders via checking legend
|
||||
|
||||
@@ -40,7 +40,7 @@ e2e.scenario({
|
||||
e2e()
|
||||
.get('.markdown-html li')
|
||||
.should('have.length', 23)
|
||||
.each(element => {
|
||||
.each((element) => {
|
||||
items.push(element.text());
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -32,7 +32,7 @@ e2e.scenario({
|
||||
.labels()
|
||||
.should('be.visible')
|
||||
.last()
|
||||
.should(element => {
|
||||
.should((element) => {
|
||||
timesInUtc[title] = element.text();
|
||||
})
|
||||
);
|
||||
@@ -43,18 +43,11 @@ e2e.scenario({
|
||||
e2e.components.TimeZonePicker.container()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.singleValue()
|
||||
.should('be.visible')
|
||||
.should('have.text', fromTimeZone);
|
||||
e2e.components.Select.singleValue().should('be.visible').should('have.text', fromTimeZone);
|
||||
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().should('be.visible').click();
|
||||
|
||||
e2e.components.Select.option()
|
||||
.should('be.visible')
|
||||
.contains(toTimeZone)
|
||||
.click();
|
||||
e2e.components.Select.option().should('be.visible').contains(toTimeZone).click();
|
||||
});
|
||||
|
||||
e2e.components.BackButton.backArrow().click();
|
||||
@@ -67,7 +60,7 @@ e2e.scenario({
|
||||
.labels()
|
||||
.should('be.visible')
|
||||
.last()
|
||||
.should(element => {
|
||||
.should((element) => {
|
||||
const utc = timesInUtc[title];
|
||||
const tz = element.text();
|
||||
const isCorrect = isTimeCorrect(utc, tz, offset);
|
||||
@@ -81,14 +74,9 @@ e2e.scenario({
|
||||
const isTimeCorrect = (utc: string, tz: string, offset: number): boolean => {
|
||||
const minutes = 1000 * 60;
|
||||
|
||||
const a = Cypress.moment(utc, 'HH:mm')
|
||||
.set('seconds', 0)
|
||||
.set('milliseconds', 0);
|
||||
const a = Cypress.moment(utc, 'HH:mm').set('seconds', 0).set('milliseconds', 0);
|
||||
|
||||
const b = Cypress.moment(tz, 'HH:mm')
|
||||
.set('seconds', 0)
|
||||
.set('milliseconds', 0)
|
||||
.add('hours', offset);
|
||||
const b = Cypress.moment(tz, 'HH:mm').set('seconds', 0).set('milliseconds', 0).add('hours', offset);
|
||||
|
||||
return a.diff(b, 'minutes') <= 6 * minutes;
|
||||
};
|
||||
|
||||
@@ -14,14 +14,9 @@ e2e.scenario({
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().should('be.visible').click();
|
||||
|
||||
cy.contains('CSV Metric Values')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
|
||||
});
|
||||
|
||||
const canvases = e2e().get('canvas');
|
||||
|
||||
@@ -13,10 +13,7 @@ e2e.scenario({
|
||||
cy.wait(1000);
|
||||
|
||||
// check that gauges are rendered
|
||||
e2e()
|
||||
.get('body')
|
||||
.find(`.flot-base`)
|
||||
.should('have.length', 16);
|
||||
e2e().get('body').find(`.flot-base`).should('have.length', 16);
|
||||
|
||||
// check that no panel errors exist
|
||||
e2e.components.Panels.Panel.headerCornerInfo('error').should('not.exist');
|
||||
|
||||
@@ -10,7 +10,7 @@ e2e.scenario({
|
||||
skipScenario: false,
|
||||
scenario: () => {
|
||||
// @ts-ignore some typing issue
|
||||
e2e().on('uncaught:exception', err => {
|
||||
e2e().on('uncaught:exception', (err) => {
|
||||
if (err.stack?.indexOf("TypeError: Cannot read property 'getText' of null") !== -1) {
|
||||
// On occasion monaco editor will not have the time to be properly unloaded when we change the tab
|
||||
// and then the e2e test fails with the uncaught:exception:
|
||||
@@ -51,9 +51,7 @@ e2e.scenario({
|
||||
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
|
||||
|
||||
e2e.components.QueryTab.queryInspectorButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryTab.queryInspectorButton().should('be.visible').click();
|
||||
|
||||
e2e.components.Drawer.General.title(`Inspect: ${PANEL_UNDER_TEST}`)
|
||||
.should('be.visible')
|
||||
@@ -82,25 +80,19 @@ const expectDrawerTabsAndContent = () => {
|
||||
e2e.components.PanelInspector.Query.content().should('not.be.visible');
|
||||
|
||||
// other tabs should also be visible, click on each to see if we get any console errors
|
||||
e2e.components.Tab.title('Stats')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Stats').should('be.visible').click();
|
||||
e2e.components.PanelInspector.Stats.content().should('be.visible');
|
||||
e2e.components.PanelInspector.Data.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Json.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Query.content().should('not.be.visible');
|
||||
|
||||
e2e.components.Tab.title('JSON')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('JSON').should('be.visible').click();
|
||||
e2e.components.PanelInspector.Json.content().should('be.visible');
|
||||
e2e.components.PanelInspector.Data.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Stats.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Query.content().should('not.be.visible');
|
||||
|
||||
e2e.components.Tab.title('Query')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Query').should('be.visible').click();
|
||||
|
||||
e2e.components.PanelInspector.Query.content().should('be.visible');
|
||||
e2e.components.PanelInspector.Data.content().should('not.be.visible');
|
||||
@@ -142,10 +134,7 @@ const expectDrawerExpandAndContract = (viewPortWidth: number) => {
|
||||
const expectSubMenuScenario = (subMenu: string, tabTitle?: string) => {
|
||||
tabTitle = tabTitle ?? subMenu;
|
||||
// testing opening inspect drawer from sub menus under Inspect in header menu
|
||||
e2e.components.Panels.Panel.title(PANEL_UNDER_TEST)
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Panels.Panel.title(PANEL_UNDER_TEST).scrollIntoView().should('be.visible').click();
|
||||
|
||||
// sub menus are in the DOM but not visible and because there is no hover support in Cypress force click
|
||||
// https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/testing-dom__hover-hidden-elements/cypress/integration/hover-hidden-elements-spec.js
|
||||
|
||||
@@ -31,22 +31,16 @@ e2e.scenario({
|
||||
|
||||
// Bottom pane tabs
|
||||
// Can change to Transform tab
|
||||
e2e.components.Tab.title('Transform')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
e2e.components.Tab.active().within((li: JQuery<HTMLLIElement>) => {
|
||||
expect(li.text()).equals('Transform0'); // there's no transform so therefore Transform + 0
|
||||
});
|
||||
e2e.components.Transforms.card('Merge')
|
||||
.scrollIntoView()
|
||||
.should('be.visible');
|
||||
e2e.components.Transforms.card('Merge').scrollIntoView().should('be.visible');
|
||||
e2e.components.QueryTab.content().should('not.be.visible');
|
||||
e2e.components.AlertTab.content().should('not.be.visible');
|
||||
|
||||
// Can change to Alerts tab (graph panel is the default vis so the alerts tab should be rendered)
|
||||
e2e.components.Tab.title('Alert')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Alert').should('be.visible').click();
|
||||
e2e.components.Tab.active().within((li: JQuery<HTMLLIElement>) => {
|
||||
expect(li.text()).equals('Alert0'); // there's no alert so therefore Alert + 0
|
||||
});
|
||||
@@ -54,9 +48,7 @@ e2e.scenario({
|
||||
e2e.components.QueryTab.content().should('not.be.visible');
|
||||
e2e.components.TransformTab.content().should('not.exist');
|
||||
|
||||
e2e.components.Tab.title('Query')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Query').should('be.visible').click();
|
||||
});
|
||||
|
||||
// Panel sidebar is rendered open by default
|
||||
@@ -79,9 +71,7 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.OptionsPane.content().should('be.visible');
|
||||
|
||||
// Can change visualisation type
|
||||
e2e.components.OptionsGroup.toggle('Panel type')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.OptionsGroup.toggle('Panel type').should('be.visible').click();
|
||||
|
||||
// Check that Graph is chosen
|
||||
e2e.components.PluginVisualization.item('Graph').should('be.visible');
|
||||
@@ -90,10 +80,7 @@ e2e.scenario({
|
||||
});
|
||||
|
||||
// Change to Text panel
|
||||
e2e.components.PluginVisualization.item('Text')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.PluginVisualization.item('Text').scrollIntoView().should('be.visible').click();
|
||||
e2e.components.PluginVisualization.current().within((div: JQuery<HTMLDivElement>) => {
|
||||
expect(div.text()).equals('Text');
|
||||
});
|
||||
@@ -102,10 +89,7 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.DataPane.content().should('not.be.visible');
|
||||
|
||||
// Change to Table panel
|
||||
e2e.components.PluginVisualization.item('Table')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.PluginVisualization.item('Table').scrollIntoView().should('be.visible').click();
|
||||
e2e.components.PluginVisualization.current().within((div: JQuery<HTMLDivElement>) => {
|
||||
expect(div.text()).equals('Table');
|
||||
});
|
||||
@@ -122,9 +106,7 @@ e2e.scenario({
|
||||
e2e.components.OverridesConfigEditor.content().should('not.be.visible');
|
||||
|
||||
e2e.components.PanelEditor.OptionsPane.tab('Field').should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.tab('Overrides')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.PanelEditor.OptionsPane.tab('Overrides').should('be.visible').click();
|
||||
|
||||
e2e.components.OverridesConfigEditor.content().should('be.visible');
|
||||
e2e.components.FieldConfigEditor.content().should('not.be.visible');
|
||||
|
||||
@@ -21,7 +21,7 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.DataPane.content().should('be.visible');
|
||||
|
||||
// We expect row with refId A to exist and be visible
|
||||
e2e.components.QueryEditorRows.rows().within(rows => {
|
||||
e2e.components.QueryEditorRows.rows().within((rows) => {
|
||||
expect(rows.length).equals(1);
|
||||
});
|
||||
|
||||
@@ -34,37 +34,28 @@ e2e.scenario({
|
||||
.as('apiPostQuery');
|
||||
|
||||
// Add query button should be visible and clicking on it should create a new row
|
||||
e2e.components.QueryTab.addQuery()
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryTab.addQuery().scrollIntoView().should('be.visible').click();
|
||||
|
||||
// We expect row with refId A and B to exist and be visible
|
||||
e2e.components.QueryEditorRows.rows().within(rows => {
|
||||
e2e.components.QueryEditorRows.rows().within((rows) => {
|
||||
expect(rows.length).equals(2);
|
||||
});
|
||||
|
||||
// Remove refId A
|
||||
e2e.components.QueryEditorRow.actionButton('Remove query')
|
||||
.eq(0)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryEditorRow.actionButton('Remove query').eq(0).should('be.visible').click();
|
||||
|
||||
e2e().wait('@apiPostQuery');
|
||||
|
||||
// We expect row with refId B to exist and be visible
|
||||
e2e.components.QueryEditorRows.rows().within(rows => {
|
||||
e2e.components.QueryEditorRows.rows().within((rows) => {
|
||||
expect(rows.length).equals(1);
|
||||
});
|
||||
|
||||
// Duplicate refId B
|
||||
e2e.components.QueryEditorRow.actionButton('Duplicate query')
|
||||
.eq(0)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryEditorRow.actionButton('Duplicate query').eq(0).should('be.visible').click();
|
||||
|
||||
// We expect row with refId Band and A to exist and be visible
|
||||
e2e.components.QueryEditorRows.rows().within(rows => {
|
||||
e2e.components.QueryEditorRows.rows().within((rows) => {
|
||||
expect(rows.length).equals(2);
|
||||
});
|
||||
|
||||
@@ -72,49 +63,36 @@ e2e.scenario({
|
||||
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.eq(0)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().eq(0).should('be.visible').click();
|
||||
|
||||
cy.contains('CSV Metric Values')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.eq(0)
|
||||
.click();
|
||||
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').eq(0).click();
|
||||
});
|
||||
|
||||
e2e().wait('@apiPostQuery');
|
||||
|
||||
// Disable / enable row
|
||||
expectInspectorResultAndClose(keys => {
|
||||
expectInspectorResultAndClose((keys) => {
|
||||
const length = keys.length;
|
||||
expect(keys[length - 2].innerText).equals('A:');
|
||||
expect(keys[length - 1].innerText).equals('B:');
|
||||
});
|
||||
|
||||
// Disable row with refId A
|
||||
e2e.components.QueryEditorRow.actionButton('Disable/enable query')
|
||||
.eq(1)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryEditorRow.actionButton('Disable/enable query').eq(1).should('be.visible').click();
|
||||
|
||||
e2e().wait('@apiPostQuery');
|
||||
|
||||
expectInspectorResultAndClose(keys => {
|
||||
expectInspectorResultAndClose((keys) => {
|
||||
const length = keys.length;
|
||||
expect(keys[length - 1].innerText).equals('B:');
|
||||
});
|
||||
|
||||
// Enable row with refId B
|
||||
e2e.components.QueryEditorRow.actionButton('Disable/enable query')
|
||||
.eq(1)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryEditorRow.actionButton('Disable/enable query').eq(1).should('be.visible').click();
|
||||
|
||||
e2e().wait('@apiPostQuery');
|
||||
|
||||
expectInspectorResultAndClose(keys => {
|
||||
expectInspectorResultAndClose((keys) => {
|
||||
const length = keys.length;
|
||||
expect(keys[length - 2].innerText).equals('A:');
|
||||
expect(keys[length - 1].innerText).equals('B:');
|
||||
@@ -123,13 +101,9 @@ e2e.scenario({
|
||||
});
|
||||
|
||||
const expectInspectorResultAndClose = (expectCallBack: (keys: any[]) => void) => {
|
||||
e2e.components.QueryTab.queryInspectorButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.QueryTab.queryInspectorButton().should('be.visible').click();
|
||||
|
||||
e2e.components.PanelInspector.Query.refreshButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.PanelInspector.Query.refreshButton().should('be.visible').click();
|
||||
|
||||
e2e().wait('@apiPostQuery');
|
||||
|
||||
@@ -137,7 +111,5 @@ const expectInspectorResultAndClose = (expectCallBack: (keys: any[]) => void) =>
|
||||
.should('be.visible')
|
||||
.within((keys: any) => expectCallBack(keys));
|
||||
|
||||
e2e.components.Drawer.General.close()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Drawer.General.close().should('be.visible').click();
|
||||
};
|
||||
|
||||
@@ -13,13 +13,9 @@ e2e.scenario({
|
||||
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
|
||||
|
||||
e2e.components.Tab.title('Transform')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Tab.title('Transform').should('be.visible').click();
|
||||
|
||||
e2e.components.TransformTab.newTransform('Reduce')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.TransformTab.newTransform('Reduce').should('be.visible').click();
|
||||
|
||||
e2e.components.Transforms.Reduce.calculationsLabel().should('be.visible');
|
||||
},
|
||||
|
||||
@@ -11,21 +11,13 @@ e2e.scenario({
|
||||
e2e.components.DataSourcePicker.container()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().should('be.visible').click();
|
||||
|
||||
cy.contains('gdev-prometheus')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.contains('gdev-prometheus').scrollIntoView().should('be.visible').click();
|
||||
});
|
||||
const queryText = 'http_requests_total';
|
||||
|
||||
e2e.components.QueryField.container()
|
||||
.should('be.visible')
|
||||
.type(queryText)
|
||||
.type('{backspace}');
|
||||
e2e.components.QueryField.container().should('be.visible').type(queryText).type('{backspace}');
|
||||
|
||||
cy.contains(queryText.slice(0, -1)).should('be.visible');
|
||||
|
||||
|
||||
@@ -13,18 +13,11 @@ e2e.scenario({
|
||||
e2e.components.FolderPicker.container()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.components.Select.input().should('be.visible').click();
|
||||
|
||||
e2e.components.Select.option()
|
||||
.should('be.visible')
|
||||
.first()
|
||||
.click();
|
||||
e2e.components.Select.option().should('be.visible').first().click();
|
||||
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.should('have.focus');
|
||||
e2e.components.Select.input().should('be.visible').should('have.focus');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.General.title().click();
|
||||
@@ -32,9 +25,7 @@ e2e.scenario({
|
||||
e2e.components.FolderPicker.container()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.should('not.have.focus');
|
||||
e2e.components.Select.input().should('be.visible').should('not.have.focus');
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -10,8 +10,6 @@ e2e.scenario({
|
||||
// open Panel Tests - Bar Gauge
|
||||
e2e.pages.SoloPanel.visit('ZqZnVvFZz/datasource-tests-shared-queries?orgId=1&panelId=4');
|
||||
|
||||
e2e()
|
||||
.get('canvas')
|
||||
.should('have.length', 6);
|
||||
e2e().get('canvas').should('have.length', 6);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ e2e.scenario({
|
||||
const verifyLinks = (variableValue: string) => {
|
||||
e2e.components.DashboardLinks.link()
|
||||
.should('be.visible')
|
||||
.and(links => {
|
||||
.and((links) => {
|
||||
expect(links).to.have.length.greaterThan(13);
|
||||
|
||||
for (let index = 0; index < links.length; index++) {
|
||||
@@ -46,20 +46,13 @@ e2e.scenario({
|
||||
// verify all links, should have All value
|
||||
verifyLinks('All');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('p2')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('p2').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Toolbar.navBar().click();
|
||||
|
||||
e2e.components.DashboardLinks.dropDown()
|
||||
.should('be.visible')
|
||||
.click()
|
||||
.wait('@tagsTemplatingSearch');
|
||||
e2e.components.DashboardLinks.dropDown().should('be.visible').click().wait('@tagsTemplatingSearch');
|
||||
|
||||
// verify all links, should have p2 value
|
||||
verifyLinks('p2');
|
||||
|
||||
@@ -16,16 +16,12 @@ describe('Variables - Load options from Url', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -33,16 +29,12 @@ describe('Variables - Load options from Url', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -50,16 +42,12 @@ describe('Variables - Load options from Url', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AB').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AC').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -81,16 +69,12 @@ describe('Variables - Load options from Url', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -98,16 +82,12 @@ describe('Variables - Load options from Url', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -115,16 +95,12 @@ describe('Variables - Load options from Url', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -136,7 +112,7 @@ describe('Variables - Load options from Url', () => {
|
||||
it('options set in url that do not exist should load correct options', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
// @ts-ignore some typing issue
|
||||
e2e().on('uncaught:exception', err => {
|
||||
e2e().on('uncaught:exception', (err) => {
|
||||
if (err.stack?.indexOf("Couldn't find any field of type string in the results.") !== -1) {
|
||||
// return false to prevent the error from
|
||||
// failing this test
|
||||
@@ -157,16 +133,12 @@ describe('Variables - Load options from Url', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -174,26 +146,18 @@ describe('Variables - Load options from Url', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 0);
|
||||
e2e().get('.variable-option').should('have.length', 0);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 0);
|
||||
e2e().get('.variable-option').should('have.length', 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,63 +7,59 @@ describe('Variables - Add variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?editview=templating` });
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInput()
|
||||
.should('be.visible')
|
||||
.within(input => {
|
||||
.within((input) => {
|
||||
expect(input.attr('placeholder')).equals('name');
|
||||
expect(input.val()).equals('query0');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalTypeSelect()
|
||||
.should('be.visible')
|
||||
.within(select => {
|
||||
e2e.components.Select.singleValue()
|
||||
.should('be.visible')
|
||||
.should('have.text', 'Query');
|
||||
.within((select) => {
|
||||
e2e.components.Select.singleValue().should('be.visible').should('have.text', 'Query');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInput()
|
||||
.should('be.visible')
|
||||
.within(input => {
|
||||
.within((input) => {
|
||||
expect(input.attr('placeholder')).equals('optional display name');
|
||||
expect(input.val()).equals('');
|
||||
});
|
||||
e2e()
|
||||
.get('#Description')
|
||||
.should('be.visible')
|
||||
.within(input => {
|
||||
.within((input) => {
|
||||
expect(input.attr('placeholder')).equals('descriptive text');
|
||||
expect(input.val()).equals('');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalHideSelect()
|
||||
.should('be.visible')
|
||||
.within(select => {
|
||||
.within((select) => {
|
||||
e2e.components.Select.singleValue().should('have.text', '');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsDataSourceSelect()
|
||||
.should('be.visible')
|
||||
.within(select => {
|
||||
.within((select) => {
|
||||
e2e.components.Select.singleValue().should('have.text', 'gdev-testdata');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsRefreshSelect()
|
||||
.should('be.visible')
|
||||
.within(select => {
|
||||
.within((select) => {
|
||||
e2e.components.Select.singleValue().should('have.text', 'Never');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsRegExInput()
|
||||
.should('be.visible')
|
||||
.within(input => {
|
||||
.within((input) => {
|
||||
const placeholder = '/.*-(?<text>.*)-(?<value>.*)-.*/';
|
||||
expect(input.attr('placeholder')).equals(placeholder);
|
||||
expect(input.val()).equals('');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsSortSelect()
|
||||
.should('be.visible')
|
||||
.within(select => {
|
||||
.within((select) => {
|
||||
e2e.components.Select.singleValue().should('have.text', 'Disabled');
|
||||
});
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsMultiSwitch().should('not.be.checked');
|
||||
@@ -79,28 +75,19 @@ describe('Variables - Add variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?editview=templating` });
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInput()
|
||||
.should('be.visible')
|
||||
.clear()
|
||||
.type('a label');
|
||||
|
||||
e2e()
|
||||
.get('#Description')
|
||||
.should('be.visible')
|
||||
.clear()
|
||||
.type('a description');
|
||||
e2e().get('#Description').should('be.visible').clear().type('a description');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsDataSourceSelect()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.type('gdev-testdata')
|
||||
.type('{enter}');
|
||||
e2e.components.Select.input().should('be.visible').type('gdev-testdata').type('{enter}');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsQueryInput()
|
||||
@@ -110,29 +97,20 @@ describe('Variables - Add variable', () => {
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('exist');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().should('be.visible').click();
|
||||
|
||||
e2e().wait(500);
|
||||
|
||||
e2e.components.BackButton.backArrow()
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
e2e.components.BackButton.backArrow().should('be.visible').click({ force: true });
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
|
||||
.eq(1)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').eq(1).should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 3);
|
||||
e2e().get('.variable-option').should('have.length', 3);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
|
||||
@@ -144,28 +122,19 @@ describe('Variables - Add variable', () => {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?editview=templating` });
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInput()
|
||||
.should('be.visible')
|
||||
.clear()
|
||||
.type('a label');
|
||||
|
||||
e2e()
|
||||
.get('#Description')
|
||||
.should('be.visible')
|
||||
.clear()
|
||||
.type('a description');
|
||||
e2e().get('#Description').should('be.visible').clear().type('a description');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsDataSourceSelect()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.components.Select.input()
|
||||
.should('be.visible')
|
||||
.type('gdev-testdata')
|
||||
.type('{enter}');
|
||||
e2e.components.Select.input().should('be.visible').type('gdev-testdata').type('{enter}');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsQueryInput()
|
||||
@@ -181,36 +150,27 @@ describe('Variables - Add variable', () => {
|
||||
.click({ force: true })
|
||||
.should('be.checked');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsCustomAllInput().within(input => {
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsCustomAllInput().within((input) => {
|
||||
expect(input.attr('placeholder')).equals('blank = auto');
|
||||
expect(input.val()).equals('');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('exist');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().should('be.visible').click();
|
||||
|
||||
e2e().wait(500);
|
||||
|
||||
e2e.components.BackButton.backArrow()
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
e2e.components.BackButton.backArrow().should('be.visible').click({ force: true });
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
|
||||
.eq(1)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').eq(1).should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
|
||||
@@ -16,37 +16,24 @@ describe('Variables - Set options from ui', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Toolbar.navBar().click();
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B')
|
||||
.scrollIntoView()
|
||||
.should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('have.length', 2);
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
|
||||
.eq(0)
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').eq(0).should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -54,16 +41,12 @@ describe('Variables - Set options from ui', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 10);
|
||||
e2e().get('.variable-option').should('have.length', 10);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -91,32 +74,22 @@ describe('Variables - Set options from ui', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Toolbar.navBar().click();
|
||||
|
||||
e2e().wait('@query');
|
||||
e2e().wait(500);
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B')
|
||||
.scrollIntoView()
|
||||
.should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').scrollIntoView().should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 7);
|
||||
e2e().get('.variable-option').should('have.length', 7);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -127,16 +100,12 @@ describe('Variables - Set options from ui', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -160,32 +129,22 @@ describe('Variables - Set options from ui', () => {
|
||||
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').should('be.visible').click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Toolbar.navBar().click();
|
||||
|
||||
e2e().wait('@query');
|
||||
e2e().wait(500);
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B')
|
||||
.scrollIntoView()
|
||||
.should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
@@ -193,16 +152,12 @@ describe('Variables - Set options from ui', () => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('.variable-option')
|
||||
.should('have.length', 4);
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBA').should('be.visible');
|
||||
|
||||
@@ -2,8 +2,8 @@ import { e2e } from '@grafana/e2e';
|
||||
|
||||
const PAGE_UNDER_TEST = 'AejrN1AMz';
|
||||
|
||||
describe('TextBox - load options scenarios', function() {
|
||||
it('default options should be correct', function() {
|
||||
describe('TextBox - load options scenarios', function () {
|
||||
it('default options should be correct', function () {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: PAGE_UNDER_TEST });
|
||||
e2e().server();
|
||||
@@ -19,7 +19,7 @@ describe('TextBox - load options scenarios', function() {
|
||||
validateTextboxAndMarkup('default value');
|
||||
});
|
||||
|
||||
it('loading variable from url should be correct', function() {
|
||||
it('loading variable from url should be correct', function () {
|
||||
e2e.flows.login('admin', 'admin');
|
||||
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?var-text=not default value` });
|
||||
e2e().server();
|
||||
@@ -36,15 +36,13 @@ describe('TextBox - load options scenarios', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe.skip('TextBox - change query scenarios', function() {
|
||||
it('when changing the query value and not saving current as default should revert query value', function() {
|
||||
describe.skip('TextBox - change query scenarios', function () {
|
||||
it('when changing the query value and not saving current as default should revert query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
changeQueryInput();
|
||||
|
||||
e2e.components.BackButton.backArrow()
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
e2e.components.BackButton.backArrow().should('be.visible').click({ force: true });
|
||||
|
||||
validateTextboxAndMarkup('changed value');
|
||||
|
||||
@@ -65,14 +63,12 @@ describe.skip('TextBox - change query scenarios', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('when changing the query value and saving current as default should change query value', function() {
|
||||
it('when changing the query value and saving current as default should change query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
changeQueryInput();
|
||||
|
||||
e2e.components.BackButton.backArrow()
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
e2e.components.BackButton.backArrow().should('be.visible').click({ force: true });
|
||||
|
||||
validateTextboxAndMarkup('changed value');
|
||||
|
||||
@@ -94,8 +90,8 @@ describe.skip('TextBox - change query scenarios', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe.skip('TextBox - change picker value scenarios', function() {
|
||||
it('when changing the input value and not saving current as default should revert query value', function() {
|
||||
describe.skip('TextBox - change picker value scenarios', function () {
|
||||
it('when changing the input value and not saving current as default should revert query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
changeTextBoxInput();
|
||||
@@ -118,7 +114,7 @@ describe.skip('TextBox - change picker value scenarios', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('when changing the input value and saving current as default should change query value', function() {
|
||||
it('when changing the input value and saving current as default should change query value', function () {
|
||||
copyExistingDashboard();
|
||||
|
||||
changeTextBoxInput();
|
||||
@@ -167,17 +163,11 @@ function copyExistingDashboard() {
|
||||
|
||||
e2e().wait('@dash-settings');
|
||||
|
||||
e2e.pages.Dashboard.Settings.General.saveAsDashBoard()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.General.saveAsDashBoard().should('be.visible').click();
|
||||
|
||||
e2e.pages.SaveDashboardAsModal.newName()
|
||||
.should('be.visible')
|
||||
.type(`${Date.now()}`);
|
||||
e2e.pages.SaveDashboardAsModal.newName().should('be.visible').type(`${Date.now()}`);
|
||||
|
||||
e2e.pages.SaveDashboardAsModal.save()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.SaveDashboardAsModal.save().should('be.visible').click();
|
||||
|
||||
e2e().wait('@save-dash');
|
||||
e2e().wait('@load-dash');
|
||||
@@ -186,30 +176,22 @@ function copyExistingDashboard() {
|
||||
|
||||
e2e()
|
||||
.location()
|
||||
.then(loc => {
|
||||
.then((loc) => {
|
||||
const dashuid = /\/d\/(\w+)\//.exec(loc.href)![1];
|
||||
e2e()
|
||||
.wrap(dashuid)
|
||||
.as('dashuid');
|
||||
e2e().wrap(dashuid).as('dashuid');
|
||||
});
|
||||
|
||||
e2e().wait(500);
|
||||
}
|
||||
|
||||
function saveDashboard(saveVariables: boolean) {
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Save dashboard')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Save dashboard').should('be.visible').click();
|
||||
|
||||
if (saveVariables) {
|
||||
e2e.pages.SaveDashboardModal.saveVariables()
|
||||
.should('exist')
|
||||
.click({ force: true });
|
||||
e2e.pages.SaveDashboardModal.saveVariables().should('exist').click({ force: true });
|
||||
}
|
||||
|
||||
e2e.pages.SaveDashboardModal.save()
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.SaveDashboardModal.save().should('be.visible').click();
|
||||
|
||||
e2e().wait('@save-dash');
|
||||
}
|
||||
@@ -219,34 +201,22 @@ function validateTextboxAndMarkup(value: string) {
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemLabels('text').should('be.visible');
|
||||
e2e()
|
||||
.get('input')
|
||||
.should('be.visible')
|
||||
.should('have.value', value);
|
||||
e2e().get('input').should('be.visible').should('have.value', value);
|
||||
});
|
||||
|
||||
e2e.components.Panels.Visualization.Text.container()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e()
|
||||
.get('h1')
|
||||
.should('be.visible')
|
||||
.should('have.text', `variable: ${value}`);
|
||||
e2e().get('h1').should('be.visible').should('have.text', `variable: ${value}`);
|
||||
});
|
||||
}
|
||||
|
||||
function validateVariable(value: string) {
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.General.sectionItems('Variables')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.General.sectionItems('Variables').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.List.tableRowNameFields('text')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.tableRowNameFields('text').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.TextBoxVariable.textBoxOptionsQueryInput()
|
||||
.should('be.visible')
|
||||
@@ -269,23 +239,17 @@ function changeTextBoxInput() {
|
||||
|
||||
e2e()
|
||||
.location()
|
||||
.should(loc => {
|
||||
.should((loc) => {
|
||||
expect(loc.search).to.contain('var-text=changed%20value');
|
||||
});
|
||||
}
|
||||
|
||||
function changeQueryInput() {
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Toolbar.toolbarItems('Dashboard settings').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.General.sectionItems('Variables')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.General.sectionItems('Variables').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.List.tableRowNameFields('text')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
e2e.pages.Dashboard.Settings.Variables.List.tableRowNameFields('text').should('be.visible').click();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.TextBoxVariable.textBoxOptionsQueryInput()
|
||||
.should('be.visible')
|
||||
|
||||
Reference in New Issue
Block a user