Skip to content

Commit

Permalink
chore: tests (v2)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelpashkovsky committed Oct 13, 2022
1 parent 0df0419 commit 03ef37f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress-tests.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
config-file: cypress/cypress.json
env:
# keep the server quiet
PYROSCOPE_LOG_LEVEL: error
PYROSCOPE_LOG_LEVEL: debug
ENABLED_SPIES: none

cypress-tests-auth:
Expand Down Expand Up @@ -136,4 +136,4 @@ jobs:
env:
# keep the server quiet
PYROSCOPE_BASE_URL: 'http://localhost:8080/pyroscope'
PYROSCOPE_LOG_LEVEL: error
PYROSCOPE_LOG_LEVEL: debug
38 changes: 38 additions & 0 deletions cypress/integration/webapp/annotations.ts
@@ -0,0 +1,38 @@
describe('Annotations', () => {
it('add annotation flow works as expected', () => {
cy.visit('/').wait(3000);

cy.findByTestId('timeline-single').click();

cy.get('li[role=menuitem]').contains('Add annotation').click();

const content = 'this is annotation content';
let time;

cy.get('form#annotation-form')
.findByTestId('annotation_timestamp_input')
.invoke('val')
.then((sometext) => (time = sometext));

cy.get('form#annotation-form')
.findByTestId('annotation_content_input')
.type(content);

cy.get('button[form=annotation-form]').click();

cy.findByTestId('annotation_mark_wrapper').click();

cy.get('form#annotation-form')
.findByTestId('annotation_content_input')
.should('have.value', content);

cy.get('form#annotation-form')
.findByTestId('annotation_timestamp_input')
.invoke('val')
.then((sometext2) => assert.isTrue(sometext2 === time));

cy.get('button[form=annotation-form]').contains('Close').click();

cy.get('form#annotation-form').should('not.exist');
});
});

0 comments on commit 03ef37f

Please sign in to comment.