Skip to content

Commit

Permalink
fix(ci): flaky smoke test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Aug 4, 2022
1 parent f06b8eb commit 96d732d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions smoke-test/tests/cypress/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"viewportHeight": 960,
"viewportWidth": 1536,
"projectId": "hkrxk5",
"defaultCommandTimeout": 10000,
"retries": {
"runMode": 2,
"openMode": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
describe('mutations', () => {
before(() => {
// warm up elastic by issuing a `*` search
cy.login();
cy.visit('http://localhost:9002/search?query=%2A');
cy.wait(5000);
});
Expand Down Expand Up @@ -118,7 +119,7 @@ describe('mutations', () => {
// verify dataset shows up in search now
cy.contains('of 1 result').click();
cy.contains('cypress_logging_events').click();
cy.contains('CypressTestAddTag2').within(() => cy.get('span[aria-label=close]').click());
cy.contains('CypressTestAddTag2').within(() => cy.get('span[aria-label=close]').trigger('mouseover', {force: true}).click());
cy.contains('Yes').click();

cy.contains('CypressTestAddTag2').should('not.exist');
Expand Down
6 changes: 4 additions & 2 deletions smoke-test/tests/cypress/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ def test_run_cypress(frontend_session, wait_for_healthchecks):
record_key = os.getenv("CYPRESS_RECORD_KEY")
if record_key:
print('Running Cypress tests with recording')
command = f"NO_COLOR=1 npx cypress run --record"
command = "NO_COLOR=1 npx cypress run --record"
else:
print('Running Cypress tests without recording')
command = f"NO_COLOR=1 npx cypress run"
command = "NO_COLOR=1 npx cypress run"
# Add --headed --spec '**/mutations/mutations.js' (change spec name)
# in case you want to see the browser for debugging
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd="tests/cypress")
stdout = proc.stdout.read()
stderr = proc.stderr.read()
Expand Down

0 comments on commit 96d732d

Please sign in to comment.