Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: components/test/data/password_manager/README

Issue 273523004: Password Manager testing automation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cmd Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/test/data/password_manager/README
diff --git a/components/test/data/password_manager/README b/components/test/data/password_manager/README
new file mode 100644
index 0000000000000000000000000000000000000000..f167ef3c1169700ae1d0eb6ce60f9e122f4186d8
--- /dev/null
+++ b/components/test/data/password_manager/README
@@ -0,0 +1,145 @@
+This file contains high-level info about how to use password manager tests and
+how to create new ones.
+
+The password manager tests purpose is to allow automatic password manager
+checking and avoiding to do so manually.
+The tests are written in python using selenium Webdriver library.
+
+
+=====Getting started=====
+
+Build ChromeDriver by building the 'chromedriver' target. This will
+create an executable binary in the build folder named 'chromedriver[.exe]'.
+
+Build chrome too by building the 'chrome' target. This will
+create an executable binary in the build folder named 'chrome[.exe]'.
+
+Install Selenium (the version tested was 2.41.0):
+pip install -U selenium
+
+Change the chrome path, chromedriver path and the new profile path in
+environment.py : new profile path has to be just an empty folder.
+
+For security reasons, we didn't publish the passwords and the usernames we
+used to test. So we put them to an xml file (websites.xml). The structure of
+the file is the following:
+<websites>
+ <website name = "website name">
+ <username>username</username>
+ <password>password</password>
+ </website>
+<websites>
+You can ask someone to give you the websites.xml file and put it in the same
+folder as the tests. You can also create your own websites.xml with your
+personal accounts.
+
+Run all the working tests tests by executing:
+python tests.py
+
+Run all the tests tests by executing:
vabr (Chromium) 2014/05/08 13:53:45 tests tests -- typo?
rchtara 2014/05/14 11:58:04 Done.
+python tests.py -all
+
+Run one or many tests by executing:
+python tests.py google
+python tests.py google facebook
+python tests.py google facebook amazon
+
+=====Creating new test=====
+
+1) Open tests.py.
+
+2) Add these lines :
+website = environment.AddWebsite("website name",
+ "username",
+ "password")
+* For security reasons, you can use websites.xml which is a private to keep
+your passwords. You have to add the following line to the xml file:
+
+<website name = "website name">
+ <username>username</username>
+ <password>password</password>
+</website>
+
+Then, to create the new test, you need just to add:
+website = environment.AddWebsite("website name")
+
+3) Add login actions: login actions are a sequence of elementary steps
+that you need to do to login.
+The actions that you can use are:
+* goto: go to some url
+website.AddLoginAction("goto", "url")
+* wait: wait for some amount of time.
+website.AddLoginAction("wait", 10)
+* click: find an element using CSS Selector and click on it.
+website.AddLoginAction("click", "css_selector")
+* hover: find an element using CSS Selector and hover it.
+website.AddLoginAction("hover", "css_selector")
+* fillusername: find an input element using CSS Selector and fill it with
+the username.
+website.AddLoginAction("fillusername", "css_selector")
+* optinalfillusername: find an input element using CSS Selector and fill it
vabr (Chromium) 2014/05/08 13:53:45 typo: optinal -> optional
rchtara 2014/05/14 11:58:04 Done.
+with the username. Don't break if the input element is not available.
vabr (Chromium) 2014/05/08 13:53:45 nit: "Don't break" -> "Do nothing" (It's not clear
vabr (Chromium) 2014/05/08 13:53:45 available -> visible
rchtara 2014/05/14 11:58:04 Done.
rchtara 2014/05/14 11:58:04 Done.
+website.AddLoginAction("optinalfillusername", "css_selector")
+* fillpassword: find an input element using CSS Selector and fill it with
+the password.
+website.AddLoginAction("password", "css_selector")
+* submit: find an element using CSS Selector and submit it.
+website.AddLoginAction("submit", "css_selector")
+* enter: find an element using CSS Selector and send enter to it.
+website.AddLoginAction("enter", "css_selector")
+
+4) Add logout actions: logout actions are a sequence of elementary steps
+that you need to do to logout.
+The actions are the same as for the login ones.
+
+
+=====Files structure=====
+
+Classes:
+* action.py: Action is defined here. addLoginAction and addLogoutAction in the
+class website create an instance of Action. If you need a new kind of files
vabr (Chromium) 2014/05/08 13:53:45 I'm not sure I understand what "new kind of files"
rchtara 2014/05/14 11:58:04 Done.
+you can add it here.
+* environment.py: the definition the tests Environment.
+* website.py: Website is defined here. You need to create an instance of this
+class for each website you want to test.
+
+Tests:
+* tests.py: the tests setup and the configuration for each website happens
+here. This file contain 3 separate kinds of tests:
+
+1) working tests: tests that are supposed to work. If you have a problem with
+one of them, rerun it again. Or try using the Known Issues section to fix it.
+2) tests that can cause a crash (the cause of the crash is not related to the
+password manager): This means that this set is expected to become a working
+test or failing test when the issue that causes the crash now is solved.
+3) failing tests: tests that fail for known bug related to the password
+manager. When this bug is solved, all the tests that were failing because of
+it are going to be moved to working tests.
+
+Other files:
+* websites.xml : a private file where you can find all the passwords. You can
+ask someone to give it to you or just create your own with your personal
+accounts.
+<websites>
+ <website name = "website name">
+ <username>username</username>
+ <password>password</password>
+ </website>
+</websites>
+
+
+=====Known Issues=====
+
+The tests are very fragile. Here are some suggestions for solving most of the
+problems:
+* Restart the tests.
+* Remove the profile if the tests fail at the beginning for unknown reason.
+* If tests fail, isolate the one that causes problem, read the log and keep
+your eyes on the browser window to understand its causes:
+a) In the tests, we often need to wait for a menu to appear ... If the
+menu takes more time to appear than expected, the tests are going to fail.
+b) The websites change very often. And even if they are not changed, they some
+time show a popup that broke the tests. In the case you need to login manually
+to the website, close all popup and logout.
+* If you are logged in when the tests crashes, don't forget to log out before
+running the tests a second time.
« no previous file with comments | « no previous file | components/test/data/password_manager/action.py » ('j') | components/test/data/password_manager/action.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698