-
Notifications
You must be signed in to change notification settings - Fork 6
Automated Testing FAQ's
-
element vs. executeScript
The protractor element selector behaves differently from the executeScript jQuery function in one very important way. With the element selector, you get the position of that element on the document by it's x,y coordinates. This has caused some issues with elements getting scrolled behind the navbar that are no longer clickable because the click action targets the navbar. With executeScript, you are given the element that you selected rather than the position of that element. This allows actions to be performed on that element when it is hidden behind other elements on the page (maybe because of a scroll event).
-
ignoreSynchronization
The
browser.ignoreSynchronization
option can be set totrue
to force code execution to wait until $http requests have returned from the server. Set this option to false to allow code execution to continue while $http requests are being performed. This is useful for testing if buttons are disabled during code execution.
-
Page being automatically reloaded during test ? I am writing test for recordset in Chaise. But after page is loaded, the address bar is updated with extra “/” after “#”.So the original url
http://…/#1234/schema:table
which becomeshttp://…/#/1234/schema:table
, and that causes app to throw error.This issue has been documented here. It happens because of the default angular routing. Protractor depends on it. We are not using the default angular routing in Chaise and Protractor tries to use that when we are changing the location using
browser.get
. For now you just want to get rid of the explicit routing that has been added in your apps as seen here.
-
There are errors with the import module 'ermrest-data-utils' importing schemas in the test
This is mostly because of some changes in the
ermrest-data-utils
module. Just update it using commandnpm update ermrest-data-utils
-
Test Failed: "defer.fulfill" is not a function
This is mostyl because of a newer version of the promise library Q. We have fixed the version to
^1.4.1
. If you face issues with any other modules, just try to fix their version numbers in thepackage.json
to the last stable version.
-
Installation issues: saying selenium not found or unable to run tests because of selenium issue or some other module issue
The best way to tackle this is deleting your
node_modules
folder and reinstall all dependencies. Once you're done deleting the folder, runsudo make deps
. This command will install all possible dependencies defined in thepackage.json
and update your selenium-driver.An alternative is to run this command:
node_modules/.bin/webdriver-manager update --standalone
-
Error while clicking a button or finding an element, saying unable to find element/element is not clickable ?
Most of the times when you're trying to look for an element which is rendered as a result of some AJAX or asynchronous operation, you should either wait for it to be rendered or add a delay. Waiting for an element to be visible with a timeout is stable and achievable. This can be done using
browser.wait
and can be seen in action here
-
Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability.http://errors.angularjs.org/1.5.5/ng/test
You will get this error when you don't explicitly call
browser.get(browser.params.url || "");
in the beforeAll section of your test-case. You should always have a browser.get as Protractor doesn't understands which page should it run the tests against. You can refer a sample here
By default, webauthn cookies expire after 30 minutes. To change your cookie's expiration, here's how:
- If you don't have your webauthn cookie yet, get it by:
- Going to https://dev.isrd.isi.edu/chaise/search/.
- Log in.
- Open your browser's console and type
$.cookie("webauthn")
. Your cookie will be returned in the console.
- Log in to a machine (e.g. dev.isrd.isi.edu) and become the root user.
ssh dev.isrd.isi.edu
sudo su -
- Switch to the ermrestddl user.
su - ermrestddl
- Access the list of sessions from webauthn.
psql webauthn
select * from webauthn2_globus_auth.session;
- Set your new expiration timestamp for your cookie. In the following example, my cookie is
EwUuy327498dDfuidY32djh3
and I want it expire on2017-12-31
.
update webauthn2_globus_auth.session set expires='2017-12-31' where key='EwUuy327498dDfuidY32djh3';
- login to the server
- run the following command to access the db directly
sudo su -
su - ermrest
psql <catalog name>
- give isrd-tester group write access to a specific catalog
INSERT INTO _ermrest.meta (key, value) VALUES ('content-write-user', 'https://auth.globus.org/9d596ac6-22b9-11e6-b519-22000aef184d');
-- run the following command to view the current acl
select value, array_agg(key) from _ermrest.meta group by value;
- ACLs In ERMrestJS and Chaise
- Facet Examples
- Facets JSON Structure
- Logging
- Model Annotation
- Model-based Logic and Heuristics
- Preformat Annotation Guide
- Export Annotation Guide
- Pseudo-Column Logic & Heuristics
- Table Alternatives
- Intro to Docker
- Chaise Dev Guide
- Dev Onboarding
- ERMrest 101
- ERMrest Howto
- ERMrestJS Dev Guide
- Extend Javascript Array
- Custom CSS guide
- Towards a style guide