Onty.SeleniumTest.Webmail
Automated Selenium test suite for the Simple Webmail System
These tests were written in C# using Selenuium 3 API. They currently support FireFox, IE, Chrome, and PhantomJS.
Running the suite
Pre-requisites
- Microsoft Windows 7 or higher (I run on 64-bit; suite has not been tested on 32-bit so may have issues)
- Microsoft Visual Studio 2015 or higher (Community version is sufficient)
- Microsoft .NET 4.62 Developer Pack (download here; you will need to restart the machine afterwards)
- A supported web browser. Suite currently supports:
- Mozilla FireFox (version 48 is strongly suggested because higher versions of FireFox cause a crash at the end of each test.)
- Microsoft Internet Explorer (I use version 11 on 64-bit Windows 7 machine; if you use anything else your mileage may vary. Also please make sure you follow the required setup instructions in Setup section below.) (Read here for a detailed discussion on why you should use 32-bit IE WebDriver instead of 64-bit.)
- Google Chrome
- PhantomJS - a "headless" browser
Setup
- Download the entire suite, and open in Visual Studio
- In
Solution Explorer
tool window, right-click the solution ("Onty.SeleniumTest.Webmail" root entry) and clickRestore NuGet Packages
. This will download all required components and place them in appropriate locations to enable the test to run. - Browser configuration:
- All browsers: edit the
app.config
file, and changeWebDriverType
to:firefox
to run tests using Firefox, orie
for Internet Explorer, orchrome
for Chrome, orphantomjs
for PhantomJS - FireFox: Edit the
app.config
file and change thePathFirefox
entry to the actual path where FireFox is on your machine. - MSIE: Please please please make sure you follow the setup instructions
- All browsers: edit the
Actually running
- Build the solution.
- Open
Test Expolrer
tool window in Visual Studio, and clickRun All
Notes:
- Occasionally, a message that a FireFox plugin has crashed may be displayed. This does not seem to affect the test results. Just click "close" after the test finisies running. I don't know how to make the message not appear. If anyone knows how to fix it, please tell me. Thanks.
- The WebDriver executables sometimes stay running in memory after the test completes. This is a deficiency of WebDriver. The test calls driver.Quit() whether test passes or fails, but every now and again you may find leftover processes.
Implemented tests
- Unauthenticated user
- Login page
- Login
- Valid login
- Invalid login
- Account pages
- View user list, and view info for currently logged in user
- Password page
- Logout
- Create a new account
- Mailbox
- Mailbox page
- Create custom folder
- Send a message and verify it was sent; also logs in as recipient and verifies that message was received
- General tests
- Check presense of all expected menu items in left-hand-side menu (this test really belongs to another category, but not sure where yet)
To do
The following tests still need to be written
- Changing the Password
- Actually change the password, logout, and try to login using new password
- Try changing to blank password (negative test)
- Try entering mismatching passwords when changing password (negative test)
- Negative tests for creating a new account
- Try to create a new account with duplicate username (negative test)
- Try to create a new account with duplicate email, same as an already existing account (negative test)
General to-do items
- Get suite to run on other browsers
- Safari
- Get suite to run with cloud testing solutions
- BrowserStack
- SauceLabs
- Currently every time a new page is retrieved, the function CommonPageElements.WaitForPageToLoad() is called. The latter is currently implemented as a simple Thread.Sleep() which works, but is a bad idea in the long-term. There need to be a better way to determine if a page has loaded. For example, there could be some hidden element at the end of the page presense of which can be used to determine if page has fully loaded. If you are reading this, and know a good way to do so, please contact me and educate me.