Skip to content

Commit 5f91687

Browse files
committed
Merge branch 'develop' into update-from-template-merged
2 parents ab27acf + d5b0a08 commit 5f91687

25 files changed

+1284
-119
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ body:
1515
attributes:
1616
label: "Checklist"
1717
options:
18-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
18+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/selenium-elements/releases/latest)"
1919
required: true
20-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
20+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/selenium-elements/issues) or [closed](https://github.com/xdev-software/selenium-elements/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2121
required: true
2222
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2323
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Checklist"
1515
options:
16-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
16+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/selenium-elements/issues) or [closed](https://github.com/xdev-software/selenium-elements/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1717
required: true
1818
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1919
required: true

.github/ISSUE_TEMPLATE/question.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/selenium-elements/issues) or [closed](https://github.com/xdev-software/selenium-elements/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.github/workflows/check-build.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ on:
2121

2222
env:
2323
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
24-
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
2524

2625
jobs:
2726
build:
@@ -64,13 +63,6 @@ jobs:
6463
exit 1
6564
fi
6665
67-
- name: Upload demo files
68-
uses: actions/upload-artifact@v4
69-
with:
70-
name: demo-files-java-${{ matrix.java }}
71-
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
72-
if-no-files-found: error
73-
7466
checkstyle:
7567
runs-on: ubuntu-latest
7668
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}

.run/Run Demo.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
4-
<module name="template-placeholder-demo" />
4+
<module name="selenium-elements-demo" />
55
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
66
<extension name="coverage">
77
<pattern>

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 1.0.4
2+
* ``ImprovedWebElement#hasAttribute`` now waits for loading operations to complete (now calls ``prepareForOperation`` - like ``getProperty`` already does)
3+
4+
# 1.0.3
5+
* Removed reflection calls in ``CustomizableJsonToWebElementConverter`` as https://github.com/SeleniumHQ/selenium/issues/15884 was fixed #11
6+
* Selenium version 4.34+ is required
7+
* Updated dependencies
8+
9+
# 1.0.2
10+
* ``ImprovedRemoteWebElement``
11+
* Make it possible to disable auto scroll
12+
* Don't throw an exception when scrolling into view is somehow not working
13+
* Improve logger initialization
14+
15+
# 1.0.1
16+
* Correctly declare ``software.xdev:testcontainers-selenium`` as scope ``test``
17+
18+
# 1.0.0
19+
_Initial release_

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ You should have the following things installed:
3434
* Ensure that the JDK/Java-Version is correct
3535

3636

37-
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
37+
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/selenium-elements/release.yml?branch=master)](https://github.com/xdev-software/selenium-elements/actions/workflows/release.yml)
3838

3939
Before releasing:
40-
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
40+
* Consider doing a [test-deployment](https://github.com/xdev-software/selenium-elements/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
4141
* Check the [changelog](CHANGELOG.md)
4242

4343
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes

README.md

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,76 @@
1-
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
2-
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
1+
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/selenium-elements?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/selenium-elements)
2+
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/selenium-elements/check-build.yml?branch=develop)](https://github.com/xdev-software/selenium-elements/actions/workflows/check-build.yml?query=branch%3Adevelop)
33

4-
# template-placeholder
4+
# <img src="https://raw.githubusercontent.com/SeleniumHQ/seleniumhq.github.io/690acbad7b4bf4656f116274809765db64e6ccf7/website_and_docs/static/images/logos/webdriver.svg" width=24 /> Elements for Selenium
55

6+
Define Selenium HTML elements as Java classes, similar to Selenium's [``@FindBy`` annotation](https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/FindBy.html).
7+
8+
Also contains a ton of other predefined utility, for example:
9+
* Automatically scrolls elements that perform operations into the view
10+
* Safe click: When an element is detected as stale a JavaScript click is executed instead
11+
* Option to globally wait until the page finished loading
12+
* Waiting for some time until the element is present (``waitUntil``)
13+
14+
Overall this should result in:
15+
* Less [flaky](https://www.browserstack.com/test-reporting-and-analytics/features/test-reporting/what-is-flaky-test) tests
16+
* Abstraction of elements in an object oriented way
17+
18+
## Usage
19+
20+
1. Define the elements you want to access
21+
```java
22+
@FindBySelector(tagName = "body")
23+
abstract class BodyElement implements ImprovedWebElement {
24+
public MyElement myElement() {
25+
return waitForFirst(MyElement.class);
26+
}
27+
}
28+
29+
@FindBySelector(id = "abc")
30+
abstract class MyElement implements ImprovedWebElement {
31+
}
32+
```
33+
2. Utilize the predefined methods and classes to get/access the elements in a test
34+
```java
35+
class MyWebDriverTest implements CanFindElements {
36+
WebDriver webDriver;
37+
38+
@BeforeEach
39+
void beforeEach() {
40+
webDriver = createWebDriver();
41+
CustomizableRemoteWebElementInstaller.install(
42+
webDriver,
43+
() -> new ImprovedRemoteWebElement(
44+
"return document.readyState == 'complete';")
45+
);
46+
}
47+
48+
@Test
49+
void test() {
50+
MyElement myElement = waitForFirst(BodyElement.class).myElement();
51+
assertEquals("Hello world", myElement.getText());
52+
53+
// Or alternatively
54+
ElementInstantiatorInstance.instance().find(webDriver, BodyElement.class);
55+
}
56+
57+
@AfterEach
58+
void afterEach() {
59+
// Stop webDriver here...
60+
webDriver = null;
61+
}
62+
63+
@Override
64+
public WebDriver getWebDriver() {
65+
return webDriver;
66+
}
67+
}
68+
```
69+
70+
You can also checkout the [integrated tests](./selenium-elements/src/test/java/) to see this in action.
671

772
## Installation
8-
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
73+
[Installation guide for the latest release](https://github.com/xdev-software/selenium-elements/releases/latest#Installation)
974

1075
## Support
1176
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
@@ -14,4 +79,6 @@ If you need support as soon as possible and you can't wait for any pull request,
1479
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
1580
1681
## Dependencies and Licenses
17-
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
82+
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/selenium-elements/dependencies)
83+
84+
<sub>Disclaimer: This is not an official Testcontainers/Selenium product and not associated</sub>

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Reporting a Vulnerability
44

5-
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
5+
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/selenium-elements/security/advisories/new).

pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>software.xdev</groupId>
8-
<artifactId>template-placeholder-root</artifactId>
9-
<version>1.0.0-SNAPSHOT</version>
8+
<artifactId>selenium-elements-root</artifactId>
9+
<version>1.0.5-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<organization>
@@ -15,8 +15,7 @@
1515
</organization>
1616

1717
<modules>
18-
<module>template-placeholder</module>
19-
<module>template-placeholder-demo</module>
18+
<module>selenium-elements</module>
2019
</modules>
2120

2221
<properties>

0 commit comments

Comments
 (0)