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

Commit

Permalink
Update cypress tests and increase delay (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuali925 committed Oct 21, 2020
1 parent f215147 commit e1373cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 5 additions & 11 deletions workbench/.cypress/integration/ui.spec.js
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
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

0 comments on commit e1373cb

Please sign in to comment.