Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Build Notes e2e test #1962

Merged
merged 1 commit into from
Jan 21, 2024
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
1 change: 1 addition & 0 deletions app/cdash/tests/js/e2e_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ add_protractor_test(subprojectGroupOrder)
add_cypress_e2e_test(calendar)
add_cypress_e2e_test(colorblind)
add_cypress_e2e_test(daterange)
add_cypress_e2e_test(build-notes)
3 changes: 0 additions & 3 deletions app/cdash/tests/selenium/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ endif()
add_selenium_test(finduserproject)
add_selenium_test(findusers)

## Not used with the new GUI
# add_selenium_test(buildnote)

add_selenium_test(editsite)
add_selenium_test(emailsubscription)
32 changes: 0 additions & 32 deletions app/cdash/tests/selenium/test_buildnote.html

This file was deleted.

22 changes: 0 additions & 22 deletions app/cdash/tests/selenium/test_buildnote.php

This file was deleted.

30 changes: 0 additions & 30 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20674,36 +20674,6 @@ parameters:
count: 1
path: app/cdash/tests/sameImage.php

-
message: "#^Call to an undefined method Example\\:\\:click\\(\\)\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Call to an undefined method Example\\:\\:mouseOver\\(\\)\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Call to an undefined method Example\\:\\:open\\(\\)\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Call to an undefined method Example\\:\\:waitForPageToLoad\\(\\)\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Method Example\\:\\:setUp\\(\\) has no return type specified\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Method Example\\:\\:testBuildNote\\(\\) has no return type specified\\.$#"
count: 1
path: app/cdash/tests/selenium/test_buildnote.php

-
message: "#^Call to an undefined method Example\\:\\:click\\(\\)\\.$#"
count: 10
Expand Down
1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ set_tests_properties(eslint PROPERTIES
)

add_vue_test(Spec/build-configure)
add_vue_test(Spec/build-notes)
add_vue_test(Spec/build-summary)
add_vue_test(Spec/edit-project)
add_vue_test(Spec/manage-measurements)
Expand Down
84 changes: 0 additions & 84 deletions tests/Spec/build-notes.spec.js

This file was deleted.

36 changes: 36 additions & 0 deletions tests/cypress/e2e/build-notes.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
describe('build notes', () => {
it('can be reached from the index page', () => {
cy.visit('index.php?project=EmailProjectExample');
cy.get('tbody').find('tr').first().find('td').eq(1).find('a[name="notesLink"]').as('notes_link');
cy.get('@notes_link').find('img').should('have.attr', 'src', 'img/document.png');
cy.get('@notes_link').click();
cy.url().should('match', /builds\/[0-9]+\/notes/);
});

it('displays contents of note', () => {
cy.visit('index.php?project=EmailProjectExample');
cy.get('tbody').find('a[name="notesLink"]').click();

// verify content of note
cy.get('#note0').should('contain', '/cdash/_build/app/cdash/tests/ctest/ctestdriver-svnUpdates.ctest');
// some expected code from the attached note
cy.get('#notetext0')
.should('contain', 'cmake_minimum_required')
.and('contain', 'submit.php?project=EmailProjectExample');

// toggle the note
cy.get('#note0').find('i').as('toggle_button');
cy.get('@toggle_button').should('have.class', 'glyphicon-chevron-down');
cy.get('@toggle_button').click();

// TODO: (sbelsk) perhaps the choice of icons for the
// collapsed and open modes should be revisited...
cy.get('@toggle_button').should('have.class', 'glyphicon-chevron-right');
cy.get('#notetext0').should('not.be.visible');
cy.get('@toggle_button').click();

// assert page is back to original state
cy.get('@toggle_button').should('have.class', 'glyphicon-chevron-down');
cy.get('#notetext0').should('be.visible');
});
});