-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert the queryTest e2e test to cypress
- Loading branch information
Showing
4 changed files
with
51 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe('query tests', () => { | ||
function filter_test(field, compare, value, num_builds) { | ||
// load the filtered page | ||
const filter_url = `queryTests.php?project=InsightExample&filtercount=1&field1=${field}&compare1=${compare}&value1=${value}`; | ||
cy.visit(filter_url); | ||
|
||
// make sure the expected number of rows are displayed | ||
cy.get('#numtests').should('contain', `Query Tests: ${num_builds} matches`); | ||
cy.get('#queryTestsTable').find('tbody').find('tr').should('have.length', num_builds); | ||
} | ||
|
||
it('filters correctly by build name', () => { | ||
filter_test('buildname', '63', 'simple', 4); | ||
}); | ||
|
||
|
||
it('filters correctly by build time', () => { | ||
filter_test('buildstarttime', '83', 'yesterday', 5); | ||
}); | ||
|
||
it('filters correctly by details', () => { | ||
filter_test('details', '61', 'Completed', 5); | ||
}); | ||
|
||
it('filters correctly by group', () => { | ||
filter_test('groupname', '61', 'Experimental', 5); | ||
filter_test('groupname', '62', 'Experimental', 0); | ||
}); | ||
|
||
it('filters correctly by site', () => { | ||
filter_test('site', '61', 'CDashTestingSite', 5); | ||
}); | ||
|
||
it('filters correctly by time', () => { | ||
// count all tests that took 0s to run | ||
filter_test('time', '41', '0', 5); | ||
|
||
// make sure all filtered tests actually have 'Time' equal to zero | ||
cy.get('#queryTestsTable').find('tbody').find('tr').each(row => { | ||
cy.wrap(row).find('td').eq(4).should('contain', '0s'); | ||
}); | ||
}); | ||
|
||
it('displays the right default filters', () => { | ||
cy.visit('index.php?project=InsightExample'); | ||
const today_str = new Date().toISOString().slice(0, 10); | ||
const default_filters = `queryTests.php?project=InsightExample&date=${today_str}&filtercount=1&showfilters=1&field1=status&compare1=62&value1=Passed`; | ||
cy.get('#navigation').find('a').contains('Tests Query').should('have.attr', 'href').and('contains', default_filters); | ||
}); | ||
}); |