https://github.com/sango-tech/ui-automation-testing
Automation UI testing for your webapp.
https://github.com/sango-tech/ui-automation-testing
automation-framework automation-test selenium selenium-python selenium-webdriver ui-automated-tests
Last synced: about 1 month ago
JSON representation
Automation UI testing for your webapp.
- Host: GitHub
- URL: https://github.com/sango-tech/ui-automation-testing
- Owner: sango-tech
- Created: 2021-04-09T04:09:49.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-09T12:12:22.000Z (about 5 years ago)
- Last Synced: 2025-03-31T00:18:30.689Z (about 1 year ago)
- Topics: automation-framework, automation-test, selenium, selenium-python, selenium-webdriver, ui-automated-tests
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Sango UI Automation Testing tool
Automation UI test is combined from Selenium + Python Unit test. This help you can set your testing scenario.
This tool is writing by Python and Docker compose.
### Structor
```
YOUR-PROJECT-DIR
├── automation-ui-testcases
│ └── test_page_not_found.py
│ └── test_something_else.py
```
### Run your app
Run your webapp first, then check your local IP if you are on local. Or directly testing on a live webapp (e.i https://my-live-website.com).
In case locally
```bash
# Get your local IP to make sure selenium can read your website from inside docker container
$ ifconfig
# .env file
TARGET_PROJECT_URL=https://192.168.1.181:8081
```
### Get started
```bash
$ cp .env.example .env
```
### Add your test
- `$ mkdir automation-ui-testcases` on `YOUR-PROJECT-DIR`
- `ln -s YOUR-PROJECT-DIR/automation-ui-testcases ./testcases`
- Create your test case on following this structor `automation-ui-testcases/test_*.py`
### Sample test code
```
from base import BaseTestCase
from selenium.common.exceptions import NoSuchElementException
class TestPageNotFound(BaseTestCase):
def test_valid_element(self):
self.set_device(self.DEVICE_DESKTOP)
driver = self.set_driver()
# This auto generate to https://192.168.1.181:8081/not-found
target_url = self.get_url("not-found")
driver.get(target_url)
# driver.implicitly_wait(3)
try:
logo_src = driver.find_element_by_css_selector(".app-logo").get_attribute("src")
self.assertIn("logo", logo_src)
h1_text = driver.find_element_by_css_selector("h1").text
self.assertEqual(h1_text, "404")
except NoSuchElementException as e:
self.fail(e)
```
### Run test
```bash
$ make test
```