mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
bump cypress to 6.3.0 (#30644)
* bump cypress to 6.3.0
* fix inspect-drawer spec
* fix panelEdit_base spec
* fix select-focus spec
* Apply suggestions from code review
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
* add be.visible assertion to new-query-variable spec to avoid flakiness
* increase waits in new-query-variable spec to avoid flakiness
* increase waits in new-query-variable spec by another 500
* remove be.visible assertion added before
* Chore: trying to fix flakiness
* skip the new-variable-query e2e test
* Chore: refactor so we might avoid flakiness
* Revert "skip the new-variable-query e2e test"
This reverts commit 203c1875c2.
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
This commit is contained in:
@@ -75,36 +75,36 @@ const expectDrawerTabsAndContent = () => {
|
||||
expect(li.text()).equals('Data');
|
||||
});
|
||||
e2e.components.PanelInspector.Data.content().should('be.visible');
|
||||
e2e.components.PanelInspector.Stats.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.PanelInspector.Stats.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Json.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Query.content().should('not.exist');
|
||||
|
||||
// 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.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.PanelInspector.Data.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Json.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Query.content().should('not.exist');
|
||||
|
||||
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.PanelInspector.Data.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Stats.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Query.content().should('not.exist');
|
||||
|
||||
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');
|
||||
e2e.components.PanelInspector.Stats.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Json.content().should('not.be.visible');
|
||||
e2e.components.PanelInspector.Data.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Stats.content().should('not.exist');
|
||||
e2e.components.PanelInspector.Json.content().should('not.exist');
|
||||
});
|
||||
};
|
||||
|
||||
const expectDrawerClose = () => {
|
||||
// close using close button
|
||||
e2e.components.Drawer.General.close().click();
|
||||
e2e.components.Drawer.General.title(`Inspect: ${PANEL_UNDER_TEST}`).should('not.be.visible');
|
||||
e2e.components.Drawer.General.title(`Inspect: ${PANEL_UNDER_TEST}`).should('not.exist');
|
||||
};
|
||||
|
||||
const expectDrawerExpandAndContract = (viewPortWidth: number) => {
|
||||
|
||||
@@ -27,7 +27,7 @@ e2e.scenario({
|
||||
});
|
||||
e2e.components.QueryTab.content().should('be.visible');
|
||||
e2e.components.TransformTab.content().should('not.exist');
|
||||
e2e.components.AlertTab.content().should('not.be.visible');
|
||||
e2e.components.AlertTab.content().should('not.exist');
|
||||
|
||||
// Bottom pane tabs
|
||||
// Can change to Transform tab
|
||||
@@ -36,8 +36,8 @@ e2e.scenario({
|
||||
expect(li.text()).equals('Transform0'); // there's no transform so therefore Transform + 0
|
||||
});
|
||||
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');
|
||||
e2e.components.QueryTab.content().should('not.exist');
|
||||
e2e.components.AlertTab.content().should('not.exist');
|
||||
|
||||
// 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();
|
||||
@@ -45,7 +45,7 @@ e2e.scenario({
|
||||
expect(li.text()).equals('Alert0'); // there's no alert so therefore Alert + 0
|
||||
});
|
||||
e2e.components.AlertTab.content().should('be.visible');
|
||||
e2e.components.QueryTab.content().should('not.be.visible');
|
||||
e2e.components.QueryTab.content().should('not.exist');
|
||||
e2e.components.TransformTab.content().should('not.exist');
|
||||
|
||||
e2e.components.Tab.title('Query').should('be.visible').click();
|
||||
@@ -56,18 +56,18 @@ e2e.scenario({
|
||||
|
||||
// Can toggle on/off sidebar
|
||||
e2e.components.PanelEditor.OptionsPane.close().should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.open().should('not.be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.open().should('not.exist');
|
||||
|
||||
// close options pane
|
||||
e2e.components.PanelEditor.OptionsPane.close().click();
|
||||
e2e.components.PanelEditor.OptionsPane.open().should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.close().should('not.be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.content().should('not.be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.close().should('not.exist');
|
||||
e2e.components.PanelEditor.OptionsPane.content().should('not.exist');
|
||||
|
||||
// open options pane
|
||||
e2e.components.PanelEditor.OptionsPane.open().click();
|
||||
e2e.components.PanelEditor.OptionsPane.close().should('be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.open().should('not.be.visible');
|
||||
e2e.components.PanelEditor.OptionsPane.open().should('not.exist');
|
||||
e2e.components.PanelEditor.OptionsPane.content().should('be.visible');
|
||||
|
||||
// Can change visualisation type
|
||||
@@ -86,7 +86,7 @@ e2e.scenario({
|
||||
});
|
||||
|
||||
// Data pane should not be rendered
|
||||
e2e.components.PanelEditor.DataPane.content().should('not.be.visible');
|
||||
e2e.components.PanelEditor.DataPane.content().should('not.exist');
|
||||
|
||||
// Change to Table panel
|
||||
e2e.components.PluginVisualization.item('Table').scrollIntoView().should('be.visible').click();
|
||||
@@ -103,12 +103,12 @@ e2e.scenario({
|
||||
e2e.components.PanelEditor.OptionsPane.tab('Field').click();
|
||||
|
||||
e2e.components.FieldConfigEditor.content().should('be.visible');
|
||||
e2e.components.OverridesConfigEditor.content().should('not.be.visible');
|
||||
e2e.components.OverridesConfigEditor.content().should('not.exist');
|
||||
|
||||
e2e.components.PanelEditor.OptionsPane.tab('Field').should('be.visible');
|
||||
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');
|
||||
e2e.components.FieldConfigEditor.content().should('not.exist');
|
||||
},
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ e2e.scenario({
|
||||
|
||||
e2e.components.Select.option().should('be.visible').first().click();
|
||||
|
||||
e2e.components.Select.input().should('be.visible').should('have.focus');
|
||||
e2e.components.Select.input().should('exist').should('have.focus');
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.Settings.General.title().click();
|
||||
@@ -25,7 +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('exist').should('not.have.focus');
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -95,27 +95,34 @@ describe('Variables - Add variable', () => {
|
||||
.type('*')
|
||||
.blur();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsRegExInput()
|
||||
.should('be.visible')
|
||||
.type('/.*C.*/')
|
||||
.blur();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('exist');
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().should('be.visible').click();
|
||||
|
||||
e2e().wait(500);
|
||||
e2e().wait(1500);
|
||||
|
||||
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.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
e2e.pages.Dashboard.SubMenu.submenuItem()
|
||||
.should('have.length', 4)
|
||||
.eq(3)
|
||||
.within(() => {
|
||||
e2e().get('.variable-option').should('have.length', 3);
|
||||
});
|
||||
e2e().get('.variable-link-wrapper').should('be.visible').click();
|
||||
e2e().wait(500);
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e().get('.variable-option').should('have.length', 1);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
||||
it('adding a multi value query variable', () => {
|
||||
@@ -142,6 +149,11 @@ describe('Variables - Add variable', () => {
|
||||
.type('*')
|
||||
.blur();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsRegExInput()
|
||||
.should('be.visible')
|
||||
.type('/.*C.*/')
|
||||
.blur();
|
||||
|
||||
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsMultiSwitch()
|
||||
.click({ force: true })
|
||||
.should('be.checked');
|
||||
@@ -163,21 +175,21 @@ describe('Variables - Add variable', () => {
|
||||
|
||||
e2e.components.BackButton.backArrow().should('be.visible').click({ force: true });
|
||||
|
||||
e2e().wait(500);
|
||||
|
||||
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.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
e2e.pages.Dashboard.SubMenu.submenuItem()
|
||||
.should('have.length', 4)
|
||||
.eq(3)
|
||||
.within(() => {
|
||||
e2e().get('.variable-option').should('have.length', 4);
|
||||
});
|
||||
e2e().get('.variable-link-wrapper').should('be.visible').click();
|
||||
e2e().wait(500);
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
e2e().get('.variable-option').should('have.length', 2);
|
||||
});
|
||||
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
|
||||
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user