Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Update cypress tests and increase delay time #792

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions workbench/.cypress/integration/ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { delay, testQueries, verifyDownloadData, files } from "../utils/constant
describe('Test PPL UI', () => {
beforeEach(() => {
cy.visit('app/opendistro-query-workbench');
cy.wait(delay);
cy.get('.euiToggle__input[title=PPL]').click();
cy.wait(delay);
});
Expand Down Expand Up @@ -58,7 +59,7 @@ describe('Test PPL UI', () => {
expect(editor.getValue()).to.equal('');
});
});

it('Test full screen view', () => {
cy.get('.euiButton__text').contains('Full screen view').should('not.exist');
cy.get('.euiTitle').contains('Query Workbench').should('exist');
Expand All @@ -70,7 +71,7 @@ describe('Test PPL UI', () => {
cy.get('.euiButton__text').contains('Full screen view').click();

cy.get('.euiTitle').should('not.exist');

cy.get('button#exit-fullscreen-button').click();
cy.wait(delay);
cy.get('.euiButton__text').contains('Full screen view').should('exist');
Expand All @@ -81,6 +82,7 @@ describe('Test PPL UI', () => {
describe('Test SQL UI', () => {
beforeEach(() => {
cy.visit('app/opendistro-query-workbench');
cy.wait(delay);
cy.get('.euiToggle__input[title=SQL]').click();
cy.wait(delay);
});
Expand Down Expand Up @@ -128,20 +130,11 @@ describe('Test SQL UI', () => {
cy.get('.euiButton__text').contains('Full screen view').should('not.exist');
cy.get('.euiTitle').contains('Query Workbench').should('exist');

cy.get('textarea.ace_text-input').eq(0).focus().type('{selectall}{backspace}', { force: true });
cy.wait(delay);
cy.get('textarea.ace_text-input').eq(0).focus().type('{selectall}{backspace}select log(balance) from accounts where abs(age) > 20;', { force: true });
cy.wait(delay);
cy.get('.euiButton__text').contains('Run').click();
cy.wait(delay);
cy.get('.euiButton__text').contains('Full screen view').click();

cy.get('.euiTitle').should('not.exist');

cy.get('button#exit-fullscreen-button').click();
cy.wait(delay);
cy.get('.euiButton__text').contains('Full screen view').should('exist');
cy.get('.euiTitle').contains('Query Workbench').should('exist');
});
});

Expand Down Expand Up @@ -169,6 +162,7 @@ describe('Test and verify SQL downloads', () => {
describe('Test table display', () => {
beforeEach(() => {
cy.visit('app/opendistro-query-workbench');
cy.wait(delay);
cy.get('.euiToggle__input[title=SQL]').click();
cy.wait(delay);
cy.get('textarea.ace_text-input').eq(0).focus().type('{selectall}{backspace}', { force: true });
Expand Down
2 changes: 1 addition & 1 deletion workbench/.cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

export const delay = 300;
export const delay = 1000;

export const verifyDownloadData = [
{
Expand Down