https://github.com/lwfwind/smart-ui-framework
smart ui automation framework to support web and moblie automaton based on spring boot,webdriver/appium,and testNg
https://github.com/lwfwind/smart-ui-framework
appium spring-boot testng webdriver
Last synced: 5 months ago
JSON representation
smart ui automation framework to support web and moblie automaton based on spring boot,webdriver/appium,and testNg
- Host: GitHub
- URL: https://github.com/lwfwind/smart-ui-framework
- Owner: lwfwind
- License: other
- Created: 2016-04-08T01:35:57.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-05T23:36:51.000Z (over 3 years ago)
- Last Synced: 2025-07-20T01:57:02.859Z (11 months ago)
- Topics: appium, spring-boot, testng, webdriver
- Language: Java
- Homepage:
- Size: 565 KB
- Stars: 15
- Watchers: 3
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Smart-ui-framework - a light, robust Web/Android/IOS UI automation framework
Smart-ui-framework is a light, robust Web/Android/IOS UI automation framework based on [Webdriver](http://seleniumhq.org/), [Appium](http://appium.io/) and [TestNG](http://testng.org/doc/index.html).
* Tags: Selenium, Appium, Webdriver, TestNG, Automation,Spring boot
## Features
* Support spring boot grammar such as @Value,@Autowired on client code
* Support page object design pattern and extend page factory support highlight element, log action, screenshot action automatically and so on
* Good support concurrent testing with multi webdriver
* Re-run failed test cases and capture screenshot automatically when testcase fails
* Support identify Toast and PopupWindow for appium through [android-automation-library](https://github.com/lwfwind/android-automation-library)
## Example
##### 1. Add maven dependency
```xml
com.github.lwfwind.automation
smart-ui-framework
3.8
```
##### 2. Create Page level Class, which annotated by @Page
```java
@Page
public class SearchPage{
private WebDriver driver;
@Value("${webPath}")
private String url;
@FindBy(id = "kw")
private WebElement searchTestBox;
@FindBy(id = "su")
private WebElement searchBtn;
public void searchFor(String text) {
driver.get(url);
searchTestBox.sendKeys(text);
searchBtn.click();
}
}
```
##### 3. Create Service Level Class, which annotated by @Service
```java
@Service
public class SearchService {
@Autowired
SearchPage searchPage;
public void search(String content){
searchPage.searchFor(content);
searchPage.verifyResult();
}
}
```
##### 4. Create TestCase Level Class, which extends TestCaseBase Class
```java
public class SearchWithServiceTest extends TestCaseBase {
@Autowired
SearchService searchService;
@Test(dataProviderClass = TestCaseData.class, dataProvider = "searchData", description = "搜索测试")
public void pageFactoryTest(String content) {
searchService.search(content);
}
}
```
##### 5. Create test listener Class to add business log on success/fail/skip, which implement ICustomTestListener Class
```java
public class TestListener implements ICustomTestListener {
@Override
public void onStart(ITestContext testContext) {
// TODO
}
@Override
public void onTestSuccess(ITestResult tr){
// TODO
}
@Override
public void onTestFailure(ITestResult tr) {
// TODO
}
@Override
public void onTestSkipped(ITestResult tr){
// TODO
}
@Override
public void onStart(ISuite iSuite){
// TODO
}
@Override
public void onFinish(ISuite iSuite){
// TODO
}
@Override
public void onStart(ITestContext testContext){
// TODO
};
@Override
public void onFinish(ITestContext testContext) {
// TODO
}
}
```
Detail please refer to [smart-ui-automation-example](https://github.com/lwfwind/smart-ui-automation-example)