Skip to content

Commit 1a1293c

Browse files
authored
Release v-2.1.0 (#82)
* Develop (#67) * Framework refactored. * Updated config. * Added funding details. * Update issue templates * Issue 55 (#62) * Added annotation @find and modified login page for new page factory. * Updated page factory annotation. * Updated config for headless mode. * Updated:- Listener to log exceptions correctly. - Added logging to page factory. * Updasted dependencies and fixed dependency breaking changes. * Reverted page factory changes. * Driver and DriverAction interfaces further modularized. * Added support for Selenium WebDriver 4.0-alpha 2 * Updating Readme. * Updated Readme, some work is pending. * Updated Readme and removed unnecessary comments from test. * Updated Readme. * Added iFrame support. * Updated readme as per suggesstion. * Updated for getting first frame. * Released v-2.0.0 * Updated Readme. * Updated CircleCI config to run analysis on each branch. * Release for v-2.1.0-Beta (#81) * Framework refactored. * Updated config. * Added funding details. * Update issue templates * Issue 55 (#62) * Added annotation @find and modified login page for new page factory. * Updated page factory annotation. * Updated config for headless mode. * Updated:- Listener to log exceptions correctly. - Added logging to page factory. * Updasted dependencies and fixed dependency breaking changes. * Reverted page factory changes. * Driver and DriverAction interfaces further modularized. * Added support for Selenium WebDriver 4.0-alpha 2 * Updating Readme. * Updated Readme, some work is pending. * Updated Readme and removed unnecessary comments from test. * Updated Readme. * Added iFrame support. * Updated readme as per suggesstion. * Updated for getting first frame. * Fixed #77, added wait strategy concept, default will be NONE. * Updated BrowserPage for new method implementation. * Added Safari browser support. * Added OS condition to fail for non-Mac platforms. * Updated Readme (#80) * Released v-2.1.0-beta1.
1 parent 9f5e814 commit 1a1293c

File tree

10 files changed

+299
-24
lines changed

10 files changed

+299
-24
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Nobody uses anything without knowing what it offers. Some of the key features wh
3434
- On-demand delay of test execution by allowing predefined delays
3535
- On-demand headless mode
3636
- Parallel execution of tests on different browsers
37-
- Support Chrome, Firefox, IE and Edge
37+
- Support Chrome, Safari, Firefox, IE and Edge
3838
- CI / CD ready
3939

4040
## :smile: How it is easy to write Tests with this Framework?
@@ -55,7 +55,7 @@ Config file is by default searched in `src/test/resources` folder. The name of t
5555
`src/test/resources/selenium-config.yaml`
5656

5757
```yaml
58-
browser: CHROME # CHROME, EDGE, FIREFOX, IE.
58+
browser: CHROME # CHROME, SAFARI, EDGE, FIREFOX, IE.
5959
url: http://demo.guru99.com/V4/ # Application URL.
6060
headless_mode: false # true, for headless, else false.
6161
params: # test specific map.
@@ -210,7 +210,7 @@ You can use the following dependency into your `pom.xml` to use this library.
210210
<dependency>
211211
<groupId>com.github.wasiqb.coteafs</groupId>
212212
<artifactId>selenium</artifactId>
213-
<version>2.0.0</version>
213+
<version>2.1.0</version>
214214
</dependency>
215215
```
216216

@@ -249,6 +249,11 @@ Or you can add the following into your `build.gradle` file.
249249
<img alt="Mohammad Faisal Khatri: Framework Tester." src="https://github.com/mfaisalkhatri.png" width=100 height=100 />
250250
</a>
251251
</li>
252+
<li>
253+
<a href="https://github.com/jayeshd7">
254+
<img alt="Jayesh Dalal: Framework Contributor." src="https://github.com/jayeshd7.png" width=100 height=100 />
255+
</a>
256+
</li>
252257
</ul>
253258
</div>
254259

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>selenium</artifactId>
6-
<version>2.0.0</version>
6+
<version>2.1.0-beta1</version>
77
<name>coteafs-selenium</name>
88
<description>Selenium WebDriver wrapper framework for clean and maintainable tests.</description>
99
<url>https://github.com/WasiqB/coteafs-selenium</url>

src/main/java/com/github/wasiqb/coteafs/selenium/core/Browser.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
import org.openqa.selenium.ie.InternetExplorerOptions;
4747
import org.openqa.selenium.remote.CapabilityType;
4848
import org.openqa.selenium.remote.DesiredCapabilities;
49+
import org.openqa.selenium.safari.SafariDriver;
50+
import org.openqa.selenium.safari.SafariOptions;
4951
import org.openqa.selenium.support.events.EventFiringWebDriver;
5052
import org.testng.Assert;
5153

@@ -92,8 +94,10 @@ private static WebDriver setupDriver (final AvailableBrowser browser) {
9294
case IE:
9395
return setupIeDriver ();
9496
case EDGE:
95-
default:
9697
return setupEdgeDriver ();
98+
case SAFARI:
99+
default:
100+
return setupSafariDriver ();
97101
}
98102
}
99103

@@ -126,12 +130,23 @@ private static WebDriver setupIeDriver () {
126130
Assert.fail ("IE is not supported.");
127131
}
128132
if (appSetting ().isHeadlessMode ()) {
129-
Assert.fail (
130-
"Internet Explorer can not run in headless mode, Set Headless setting to false in config.yaml");
133+
log.warn ("IE does not support headless mode. Hence, ignoring the same...");
131134
}
132135
return new InternetExplorerDriver (ieService, ieOptions);
133136
}
134137

138+
private static WebDriver setupSafariDriver () {
139+
log.info ("Setting up Safari driver...");
140+
if (!OS.isMac ()) {
141+
Assert.fail ("Safari is not supported.");
142+
}
143+
if (appSetting ().isHeadlessMode ()) {
144+
log.warn ("Safari does not support Headless mode. Hence, ignoring the same...");
145+
}
146+
final SafariOptions options = new SafariOptions ();
147+
return new SafariDriver (options);
148+
}
149+
135150
private String browserName;
136151
private final DriverListner listener;
137152

src/main/java/com/github/wasiqb/coteafs/selenium/core/BrowserPage.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.openqa.selenium.By;
1919
import org.openqa.selenium.WebElement;
2020

21+
import com.github.wasiqb.coteafs.selenium.core.enums.WaitStrategy;
2122
import com.github.wasiqb.coteafs.selenium.core.page.IPage;
2223

2324
/**
@@ -55,6 +56,17 @@ public ElementAction onElement (final By locator) {
5556
return new ElementAction (onDriver (), locator);
5657
}
5758

59+
/*
60+
* (non-Javadoc)
61+
* @see @see
62+
* com.github.wasiqb.coteafs.selenium.core.page.IPage#onElement(org.openqa.
63+
* selenium.By, com.github.wasiqb.coteafs.selenium.core.enums.WaitStrategy)
64+
*/
65+
@Override
66+
public ElementAction onElement (final By locator, final WaitStrategy strategy) {
67+
return new ElementAction (onDriver (), locator, strategy);
68+
}
69+
5870
/*
5971
* (non-Javadoc)
6072
* @see @see
@@ -65,4 +77,16 @@ public ElementAction onElement (final By locator) {
6577
public ElementAction onElement (final WebElement element) {
6678
return new ElementAction (onDriver (), element);
6779
}
80+
81+
/*
82+
* (non-Javadoc)
83+
* @see @see
84+
* com.github.wasiqb.coteafs.selenium.core.page.IPage#onElement(org.openqa.
85+
* selenium.WebElement,
86+
* com.github.wasiqb.coteafs.selenium.core.enums.WaitStrategy)
87+
*/
88+
@Override
89+
public ElementAction onElement (final WebElement element, final WaitStrategy strategy) {
90+
return new ElementAction (onDriver (), element, strategy);
91+
}
6892
}

0 commit comments

Comments
 (0)