Skip to content

Commit

Permalink
Merge pull request concord-consortium#400 from concord-consortium/aut…
Browse files Browse the repository at this point in the history
…omation-tests-fixes

Automation tests fixes
  • Loading branch information
tejal-shah authored Feb 10, 2022
2 parents 22e0a24 + 93a0481 commit 3796e9f
Show file tree
Hide file tree
Showing 10 changed files with 964 additions and 1,168 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/example_docs_contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"tiles":
{
"table": 1,
"graph": 1,
"graph": 2,
"map": 0,
"guide": 1,
"webview":0,
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/attribute_types_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ context('attribute types', () => {
table.getCell("2", "2", 0).should('contain', '48');
})
it('verify date', () => {
table.getCell("3", "3", 0).should('contain', 'Aug 7, 2017 12:01');
table.getCell("3", "3", 0).should('contain', '8/7/2017, 12:01 PM');
})
it('verify boolean', () => {
table.getCell("4", "4", 0).should('contain', 'false');
Expand All @@ -45,6 +45,7 @@ context('attribute types', () => {
table.getCell("6", "6", 0).find('span').should('have.class', 'dg-color-table-cell');
})
it('verify bounds', () => {
cy.wait(1500);
table.getCell("8", "8", 0).find('span').should('have.class', 'dg-boundary-thumb');
})
it('verify invalid type', () => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/codap_toolbar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ context('codap toolbar', ()=>{
cy.get('button').contains("Create New Document").click();
})
it('will open a new table', ()=>{
codap.openTile('table','new')
codap.openTile('table','-- new --')
table.getCaseTableTile().should('be.visible');
})
it('will open a graph', ()=>{
Expand Down Expand Up @@ -82,14 +82,14 @@ context('codap toolbar', ()=>{
codap.singleDialogEntry(url);
//need to verify iframe with webpage
// cy.wait(7000);
cy.wait(1500);
cy.wait(5000);
cy.getWebviewIframe().find('.concord-logo').should('be.visible')
codap.closeTile('option', 'Web Page'); //close the tile because it interferes with later tests
})
it('will open Help tile', ()=>{
var helpURL = "https://codap.concord.org/help"
codap.openTile('help', 'Help Pages')
cy.wait(1500);
cy.wait(5000);
//verify iframe of helpURL is showing and has #page-title contains "CODAP Help"
cy.getWebviewIframe().find('#page-title').should('contain', 'CODAP Help')
codap.closeTile('help', 'Help with CODAP'); //close the tile because it interferes with later tests
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/doc_save_and_restore_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ context('Tile variety', () => {
})

it('verify web page restore', () => {
cy.wait(5000)
cy.getWebviewIframe(2).find('.logo').should('exist')
})
it('verify text box restore', () => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/graph_ruler_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ context('will test graph ruler functions', ()=>{
cy.dragAttributeToTarget('table', hash[2].attribute, hash[2].axis);
graph.clickRulerTool();
graph.turnOnRulerTool('lsrl')
graph.getLSLine().attribute("stroke-opacity").should("include", '1' );
graph.getLSLine().invoke('attr', 'stroke-opacity').should('include', '1');
graph.getGraphEquationView().should('exist').and('contain','0.004')
cy.matchImageSnapshot('p_'+hash[1].attribute+'_n_'+hash[2].attribute+'_adorned');
cy.dragAttributeToTarget('table',hash[0].attribute, hash[0].axis)
cy.wait(1000)
graph.getLSLine().attribute("stroke-opacity").should("include", '1' );
graph.getLSLine().invoke('attr', 'stroke-opacity').should('include', '1');
graph.getGraphEquationView().should('exist').and('contain',' + 10.5')
cy.matchImageSnapshot('p_'+hash[0].attribute+'_n_'+hash[2].axis+'_adorned');
graph.clickRulerTool({force:true});
graph.turnOffRulerTool('lsrl')
cy.wait(1000);
cy.matchImageSnapshot('p_'+hash[0].attribute+'_n_'+hash[2].axis+'_unadorned');
graph.getLSLine().attribute("stroke-opacity").should("include", '0' );
graph.getLSLine().invoke('attr', 'stroke-opacity').should('include', '0');
graph.getGraphEquationView().should('have.class', 'sc-hidden')
})
it('test cat v num plot transitions',()=>{
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/plugins_tests/data_games_api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ context('Data Games API', () => {
cy.visit(baseUrl + '#file=examples:Markov%20Game');
codap.openTile('graph')
codap.openTile('table', 'Games/Turns')
cy.wait(5000)

cy.getPluginIframe().find('#levelName').invoke('text').as('level')
// run game
Expand All @@ -28,7 +29,6 @@ context('Data Games API', () => {
it('verify data is shown in table', function () {
table.getCollection().eq(0).within(() => {
table.getCell(1, 1, 0).find('.dg-numeric').should('contain', 1)
table.getCell(2, 2, 0).find('.dg-numeric').should('contain', 6)
table.getCell(4, 4, 0).should('contain', this.level)
})
table.getCollection().eq(1).within(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ context("Lab interactives", function () {
before(function () {
cy.visit(baseUrl + '#file=examples:Parachute%20Model');
//run model
cy.wait(3000);
cy.getPluginIframe().find('.ui-slider-handle').eq(0).invoke('text').as('mass')
cy.getPluginIframe().find('.ui-slider-handle').eq(1).invoke('text').as('parachuteSize')
cy.getPluginIframe().find('button.start').click();
Expand Down
16 changes: 10 additions & 6 deletions cypress/integration/table_save_and_restore_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const casecard = new CaseCardObject;

const dir = '../downloads/';
const ext = '.codap';
Cypress.config('fixturesFolder',dir)
const baseUrl = `${Cypress.config("baseUrl")}`;

before(()=> {
Expand All @@ -23,8 +22,9 @@ context('CFM functionalities with table', ()=>{
it('verify save and restore of blank table', ()=>{ //test to see if a blank table is saved properly.
var filename='blank_table'
cfm.createNewDocument();
codap.openTile('table','new');
codap.openTile('table','-- new --');
table.getCaseTableTile().should('be.visible')
cy.wait(5000);
cfm.saveToLocalDrive(filename);
cy.wait(500);
cfm.openCFMMenu();
Expand All @@ -41,10 +41,11 @@ context('CFM functionalities with table', ()=>{
it('verify save and restore of closed blank table', ()=>{ //bug found by Dan
var filename='closed_table';
// cfm.createNewDocument();
codap.openTile('table','new');
codap.openTile('table','-- new --');
table.getCaseTableTile().should('be.visible');
table.getCollection().click();
codap.closeTile('table','New Dataset');
cy.wait(5000);
cfm.saveToLocalDrive(filename);
cy.wait(500);
cfm.openCFMMenu();
Expand All @@ -62,10 +63,11 @@ context('CFM functionalities with table', ()=>{
it('verify save and restore of non-blank table', ()=>{
var filename='nonblank_table';
// cfm.createNewDocument();
codap.openTile('table','new');
codap.openTile('table','-- new --');
table.getCaseTableTile().should('be.visible');
table.getCollection().click();
// TODO: add some cases to the table
cy.wait(5000);
cfm.saveToLocalDrive(filename);
cy.wait(500);
cfm.openCFMMenu();
Expand All @@ -85,10 +87,11 @@ context('CFM functionalities with table', ()=>{
it('verify save and restore of minimized table', ()=>{
var filename='min_table';
// cfm.createNewDocument();
codap.openTile('table','new');
codap.openTile('table','-- new --');
table.getCaseTableTile().should('be.visible');
table.getCollection().click();
codap.minimizeTile();
cy.wait(5000);
cfm.saveToLocalDrive(filename);
cy.wait(500);
cfm.openCFMMenu();
Expand All @@ -106,11 +109,12 @@ context('CFM functionalities with table', ()=>{
it('verify save and restore of closed non-blank table', ()=>{
var filename='closed nonblank table';
// cfm.createNewDocument();
codap.openTile('table','new');
codap.openTile('table','-- new --');
table.getCaseTableTile().should('be.visible');
table.getCollection().click();
// TODO: add data to table
codap.closeTile('table', 'New Data');
cy.wait(5000);
cfm.saveToLocalDrive(filename);
cy.wait(500);
cfm.openCFMMenu();
Expand Down
Loading

0 comments on commit 3796e9f

Please sign in to comment.