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

End-to-end tests #649

Closed
ugurdogrusoz opened this issue Mar 25, 2021 · 13 comments
Closed

End-to-end tests #649

ugurdogrusoz opened this issue Mar 25, 2021 · 13 comments
Assignees
Labels
task Task to be done

Comments

@ugurdogrusoz
Copy link
Contributor

Let's investigate how we can implement some end-to-end tests for Newt.

@ugurdogrusoz ugurdogrusoz added the task Task to be done label Mar 25, 2021
@ugurdogrusoz ugurdogrusoz assigned canbax and hasanbalci and unassigned hasanbalci Mar 25, 2021
@ugurdogrusoz
Copy link
Contributor Author

@canbax Let's please start implementing these end-to-end tests as you have time.

canbax added a commit that referenced this issue Apr 5, 2021
canbax added a commit that referenced this issue Apr 8, 2021
canbax added a commit that referenced this issue Apr 9, 2021
canbax added a commit that referenced this issue Apr 14, 2021
canbax added a commit that referenced this issue Apr 15, 2021
canbax added a commit that referenced this issue Apr 15, 2021
@canbax
Copy link
Member

canbax commented Apr 15, 2021

Currently, there are 23 tests. 3 of them are skipped. 2 of them are because of the inability of the newt. For one I couldn't find a solution.

  1. "TC4: File -> Import -> CellDesigner": doesn't work in the newt itself
  2. "TC4: Query -> Pathway Commons -> Neighborhood...": doesn't work because it takes longer than 30 seconds and gives an error.
  3. "TC1: Add process with convenient edges": Simply I couldn't manage to do drag and drop on the canvas. This might be achieved by emitting cytoscape.js events or somehow emitting the events from cypress.io. I tried to use cypress-drag-drop but still couldn't do it.

I added the script to the crontab file. So after every regular build, the tests should be executed. The results of the tests can be observed from http://ivis.cs.bilkent.edu.tr/e2e-test-results.txt

@ugurdogrusoz
Copy link
Contributor Author

ugurdogrusoz commented Apr 16, 2021

  1. Let's use one we know imports fine, use this:
    M-Phase.xml.txt

  2. Let's use a less common Macromolecule to decrease query time: BAMBI

Can we please

  • rename test result file to "Newt-e2e-test-results.txt"?
  • document all these in Servers and Deployment doc. refer to the test document from here as well. also list any SBGN, SBML, CD, etc. files used in testing.

canbax added a commit that referenced this issue Apr 19, 2021
@canbax
Copy link
Member

canbax commented Apr 19, 2021

Currently, after every regular build, end-to-end tests should be executed. I added a small section on "i-Vis Servers and Deployment" document about end-to-end tests.

The results of the tests and the date-time that the tests are executed can be seen from http://ivis.cs.bilkent.edu.tr/Newt-e2e-test-results.txt
We are skipping one test because I couldn't find a way to do a drag-n-drop on cytoscape.js canvas.

@canbax canbax assigned ugurdogrusoz and unassigned canbax Apr 19, 2021
@ugurdogrusoz
Copy link
Contributor Author

@hasanbalci Please review, including documentation of the process.

@hasanbalci
Copy link
Contributor

It seems good. @canbax I just want to be sure, for the test of other third-party services, whether we check a new tab is opened with the given URL successfully or not for TC1 and whether we check the properties in Properties from ChEBI field one by one for TC2. In the result document, they are mentioned only as selecting macromolecule/simple chemical, so I want to be sure.

@canbax
Copy link
Member

canbax commented Apr 27, 2021

Here we are not really clicking and opening a new tab. This is mainly because cypress does not support multiple tabs. We are just checking the onclick property of the button. You can see that in

cy.contains('button.btn.btn-default', 'ChAT').should('be.visible').invoke('attr', 'onclick')
.should('eq', "window.open('https://www.genecards.org/cgi-bin/carddisp.pl?gene=ChAT', '_blank')")
If opening a new tab is important, we might try to find a way.

We are checking the 3 ChEBI fields one by one for TC2. You can see that

cy.get('tr.chemical-info.chebi-name').children('td').contains('ADP').should('be.visible');
cy.get('tr.chemical-info.chemical-description.node-details-summary').children('td').contains("A purine ribonucleoside 5'-diphosphate having adenine as the nucleobase").should('be.visible');
cy.get('tr.chemical-info.chebi-id').children('td').contains("16761").should('be.visible');

@hasanbalci
Copy link
Contributor

Actually what is important here is not opening a new tab, but to know that the URL is valid (not returns 404 error etc.) so that we can understand this website is still useful for us to get service. Is there any way to achieve this?

@hasanbalci
Copy link
Contributor

Thanks @canbax! Finally, let's add an email notifier to notify us when any of the test cases fails. These emails can be send to newteditor@gmail.com.

@hasanbalci hasanbalci assigned canbax and unassigned hasanbalci Apr 28, 2021
@hasanbalci
Copy link
Contributor

And one more thing: These tests are currently working in the unstable branch. When we merge unstable to master, test related code will also be transferred into the master branch. @canbax We'll not run tests on the master branch, but if there is something in the test codes that may affect the master branch and so will require any change we need to apply before/after merge, can you list them in the Servers and Deployment doc. as well?

canbax added a commit that referenced this issue Apr 29, 2021
canbax added a commit that referenced this issue May 4, 2021
canbax added a commit that referenced this issue May 4, 2021
@canbax
Copy link
Member

canbax commented May 4, 2021

In the Ubuntu machine, to add a new environment variable I did modify the file "/etc/environment" with nano using the command sudo nano /etc/environment

I added an environment variable like newtforminerva_pwd="..."

I did this to hide the password.

@ugurdogrusoz
Copy link
Contributor Author

Let's use the dashboard in Cypress for test results.

canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
canbax added a commit that referenced this issue May 11, 2021
@canbax
Copy link
Member

canbax commented May 17, 2021

We are storing the cypress dashboard project id as an environment variable. We are using an environment named "test0" for storing the id. Environments can be seen from https://github.com/iVis-at-Bilkent/newt/settings/environments.

@canbax canbax assigned hasanbalci and unassigned canbax May 17, 2021
canbax added a commit that referenced this issue May 17, 2021
canbax added a commit that referenced this issue May 18, 2021
canbax added a commit that referenced this issue May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Task to be done
Projects
None yet
Development

No branches or pull requests

3 participants