Skip to content

Commit 0a2dbb7

Browse files
committed
Merge branch 'develop' into update-from-template-merged
2 parents d38b73d + c09a47a commit 0a2dbb7

25 files changed

+1285
-120
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 1.0.2
2+
* ``ImprovedRemoteWebElement``
3+
* Make it possible to disable auto scroll
4+
* Don't throw an exception when scrolling into view is somehow not working
5+
* Improve logger initialization
6+
7+
# 1.0.1
8+
* Correctly declare ``software.xdev:testcontainers-selenium`` as scope ``test``
9+
10+
# 1.0.0
11+
_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: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,77 @@
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)
3-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
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)
3+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_selenium-elements&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_selenium-elements)
44

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

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

873
## Installation
9-
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
74+
[Installation guide for the latest release](https://github.com/xdev-software/selenium-elements/releases/latest#Installation)
1075

1176
## Support
1277
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).
@@ -15,4 +80,6 @@ If you need support as soon as possible and you can't wait for any pull request,
1580
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
1681
1782
## Dependencies and Licenses
18-
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
83+
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/selenium-elements/dependencies)
84+
85+
<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.3-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)