Skip to content

Commit

Permalink
feat(java): ✨ added support for multi user session (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB authored Apr 1, 2023
1 parent 4f7c8a6 commit 4cd8c21
Show file tree
Hide file tree
Showing 69 changed files with 2,199 additions and 998 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ jobs:
name: version-files
path: |
${{ github.workspace }}/core-java/pom.xml
${{ github.workspace }}/CHANGELOG.md
${{ github.workspace }}/lerna.json
${{ github.workspace }}/website/package.json
push-pom:
runs-on: ubuntu-latest
Expand All @@ -176,10 +179,14 @@ jobs:
with:
name: version-files

- name: Get previous version
id: previous-version
run: echo "old-version=$(node -p "require('./package.json').version" )" >> "$GITHUB_OUTPUT"

- name: Update new version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: ${{ needs.prepare-release.outputs.old-version }}
find: ${{ steps.previous-version.outputs.old-version }}
replace: ${{ needs.prepare-release.outputs.new-version }}
regex: false
include: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
appium driver install xcuitest
- name: Start Selenium Grid
run: java -jar core-java/libs/selenium-server-4.8.0.jar standalone > core-java/selenium-grid.log &
run: java -jar core-java/libs/selenium-server-4.8.2.jar standalone > core-java/selenium-grid.log &

- name: Launch iOS Simulator
uses: futureware-tech/simulator-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
echo "version=$MVN_VERSION" >> $GITHUB_OUTPUT
- name: Start Selenium Grid
run: java -jar core-java/libs/selenium-server-4.8.0.jar standalone > sample-tests/selenium-grid.log &
run: java -jar core-java/libs/selenium-server-4.8.2.jar standalone > sample-tests/selenium-grid.log &

- name: All Test execution
run: mvn clean test -f sample-tests/pom.xml -Dboyka.version=${{ steps.version.outputs.version }}
Expand Down
35 changes: 13 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@

## v0.13.0 (2023-02-20)
## v0.14.0 (2023-03-19)

#### :rocket: New Feature
* [#373](https://github.com/BoykaFramework/boyka-framework/pull/373) feat(java): :zap: simplified cloud configurations ([@WasiqB](https://github.com/WasiqB))
* [#411](https://github.com/BoykaFramework/boyka-framework/pull/411) feat(java): :sparkles: added hybrid app support ([@WasiqB](https://github.com/WasiqB))
* [#408](https://github.com/BoykaFramework/boyka-framework/pull/408) feat(java): :sparkles: added switch to frame using ID ([@WasiqB](https://github.com/WasiqB))
* [#410](https://github.com/BoykaFramework/boyka-framework/pull/410) feat(java): :sparkles: added form data body support ([@WasiqB](https://github.com/WasiqB))

#### :bug: Bug Fix
* [#370](https://github.com/BoykaFramework/boyka-framework/pull/370) fix(Internal): 🐛 fixes miscellaneous issues in v0.12.0 ([@WasiqB](https://github.com/WasiqB))
* [#406](https://github.com/BoykaFramework/boyka-framework/pull/406) fix(java): :bug: fixed issues in web automation ([@WasiqB](https://github.com/WasiqB))
* [#386](https://github.com/BoykaFramework/boyka-framework/pull/386) fix(java): :bug: fixed error encountered in API ([@WasiqB](https://github.com/WasiqB))
* [#381](https://github.com/BoykaFramework/boyka-framework/pull/381) fix(Internal): :bug: fixed miscellaneous issues in last release ([@WasiqB](https://github.com/WasiqB))

#### :nail_care: Polish
* [#374](https://github.com/BoykaFramework/boyka-framework/pull/374) refactor(java): :recycle: make framework intuitive ([@WasiqB](https://github.com/WasiqB))
#### :memo: Documentation
* [#407](https://github.com/BoykaFramework/boyka-framework/pull/407) docs(Internal): :memo: updated missing docs ([@WasiqB](https://github.com/WasiqB))

#### :house: Internal
* [#367](https://github.com/BoykaFramework/boyka-framework/pull/367) chore(Internal): install the CodeSee workflow. ([@codesee-maps[bot]](https://github.com/apps/codesee-maps))
* [#361](https://github.com/BoykaFramework/boyka-framework/pull/361) build(deps): bump jackson-dataformat-yaml from 2.14.1 to 2.14.2 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#363](https://github.com/BoykaFramework/boyka-framework/pull/363) build(deps): bump gson from 2.10 to 2.10.1 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#362](https://github.com/BoykaFramework/boyka-framework/pull/362) build(deps): bump maven-surefire-plugin from 3.0.0-M7 to 3.0.0-M8 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#360](https://github.com/BoykaFramework/boyka-framework/pull/360) build(deps): bump jackson-databind from 2.14.1 to 2.14.2 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#359](https://github.com/BoykaFramework/boyka-framework/pull/359) build(deps): bump checkstyle from 10.6.0 to 10.7.0 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#356](https://github.com/BoykaFramework/boyka-framework/pull/356) build(deps): bump selenium-java from 4.7.2 to 4.8.0 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#355](https://github.com/BoykaFramework/boyka-framework/pull/355) build(deps): bump maven-dependency-plugin from 3.4.0 to 3.5.0 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#354](https://github.com/BoykaFramework/boyka-framework/pull/354) build(deps): bump webdrivermanager from 5.3.1 to 5.3.2 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#353](https://github.com/BoykaFramework/boyka-framework/pull/353) build(deps): bump maven-checkstyle-plugin from 3.2.0 to 3.2.1 in /core-java ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#364](https://github.com/BoykaFramework/boyka-framework/pull/364) build(deps-dev): bump @typescript-eslint/parser from 5.49.0 to 5.50.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#366](https://github.com/BoykaFramework/boyka-framework/pull/366) build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.49.0 to 5.50.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#365](https://github.com/BoykaFramework/boyka-framework/pull/365) build(deps-dev): bump typescript from 4.9.4 to 4.9.5 ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#358](https://github.com/BoykaFramework/boyka-framework/pull/358) build(deps): bump maven-surefire-plugin from 3.0.0-M7 to 3.0.0-M8 in /sample-tests ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#357](https://github.com/BoykaFramework/boyka-framework/pull/357) build(deps): bump boyka-framework from 0.11.0 to 0.12.0 in /sample-tests ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#398](https://github.com/BoykaFramework/boyka-framework/pull/398) build(deps): bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /sample-tests ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#399](https://github.com/BoykaFramework/boyka-framework/pull/399) build(deps): bump lombok from 1.18.24 to 1.18.26 in /sample-tests ([@dependabot[bot]](https://github.com/apps/dependabot))
* [#401](https://github.com/BoykaFramework/boyka-framework/pull/401) build(deps): bump maven-surefire-plugin from 3.0.0-M8 to 3.0.0-M9 in /sample-tests ([@dependabot[bot]](https://github.com/apps/dependabot))

#### Committers: 2
#### Committers: 1
- Wasiq Bhamla ([@WasiqB](https://github.com/WasiqB))
- [@codesee-maps[bot]](https://github.com/apps/codesee-maps)
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<a href="https://mvnrepository.com/artifact/com.github.wasiqb.boyka/boyka-framework">
<img src="https://img.shields.io/maven-central/v/com.github.wasiqb.boyka/boyka-framework.svg?style=for-the-badge" alt="Maven Central" />
</a>
<a href="https://github.com/BoykaFramework/boyka-framework/releases/tag/v0.13.0">
<img src="https://img.shields.io/github/downloads/BoykaFramework/boyka-framework/v0.13.0/total?color=brightgreen&label=Downloads%20for%20v0.13.0&logo=GitHub&style=for-the-badge" alt="GitHub releases" />
<a href="https://github.com/BoykaFramework/boyka-framework/releases/tag/v0.14.0">
<img src="https://img.shields.io/github/downloads/BoykaFramework/boyka-framework/v0.14.0/total?color=brightgreen&label=Downloads%20for%20v0.14.0&logo=GitHub&style=for-the-badge" alt="GitHub releases" />
</a>
<a href="https://github.com/BoykaFramework/boyka-framework/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/BoykaFramework/boyka-framework.svg?style=for-the-badge" alt="license" />
Expand Down Expand Up @@ -64,6 +64,7 @@ This all gave me an idea of having a single framework which could solve all the
- ✅ Supports Web browser automation with support for Chrome, Edge, Firefox and Safari.
- ✅ Supports Android native apps automation
- ✅ Supports iOS native apps automation
- ✅ Allow Multi-user Multi-platform session interactions
- ✅ Supports execution of Web tests on cloud platforms like BrowserStack and LambdaTest.
- ✅ Highly configurable via `boyka-config.json`
- ✅ Micro logging to log events of the test execution
Expand All @@ -86,7 +87,7 @@ Use this space to tell a little more about your project and how it can be used.
<dependency>
<groupId>com.github.wasiqb.boyka</groupId>
<artifactId>boyka-framework</artifactId>
<version>0.13.0</version>
<version>0.14.0</version>
</dependency>
```

Expand Down Expand Up @@ -516,7 +517,7 @@ import static com.github.wasiqb.boyka.actions.elements.ElementActions.onElement;
import static com.github.wasiqb.boyka.actions.elements.FingerActions.withFinger;
import static com.github.wasiqb.boyka.actions.elements.TextBoxActions.onTextBox;
import static com.github.wasiqb.boyka.enums.PlatformType.WEB;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.testng.ui.saucedemo.pages.LoginPage.loginPage;
import static java.text.MessageFormat.format;

Expand Down Expand Up @@ -569,9 +570,9 @@ package com.github.wasiqb.boyka.testng.ui.saucedemo;

import static com.github.wasiqb.boyka.actions.drivers.DriverActions.withDriver;
import static com.github.wasiqb.boyka.actions.drivers.WindowActions.onWindow;
import static com.github.wasiqb.boyka.manager.DriverManager.closeDriver;
import static com.github.wasiqb.boyka.manager.DriverManager.createDriver;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.clearSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.createSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.google.common.truth.Truth.assertThat;

import com.github.wasiqb.boyka.enums.PlatformType;
Expand All @@ -593,14 +594,14 @@ public class SauceDemoTest {
@BeforeClass (description = "Setup test class", alwaysRun = true)
@Parameters ({ "platformType", "driverKey" })
public void setupTestClass (final PlatformType platformType, final String driverKey) {
createDriver (platformType, driverKey);
createSession ("Unique User Persona", platformType, driverKey);
this.sauceDemo = new SauceDemoActions ();
}

@AfterClass (description = "Tear down test class", alwaysRun = true)
public void tearDownTestClass () {
withDriver ().saveLogs ();
closeDriver ();
clearSession ();
}

@Test (description = "Test login functionality")
Expand Down
Binary file not shown.
9 changes: 5 additions & 4 deletions core-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.wasiqb.boyka</groupId>
<artifactId>boyka-framework</artifactId>
<version>0.13.0</version>
<version>0.14.0</version>
<inceptionYear>2022</inceptionYear>
<name>${project.groupId}:${project.artifactId}</name>
<description>🎉 Ultimate test automation for testing any application on any platform</description>
Expand All @@ -41,7 +41,7 @@
<json-path.version>2.7.0</json-path.version>
<log4j-core.version>2.20.0</log4j-core.version>
<log4j-api.version>2.20.0</log4j-api.version>
<faker.version>1.8.0</faker.version>
<faker.version>1.8.1</faker.version>
<jackson-dataformat-yaml.version>2.14.2</jackson-dataformat-yaml.version>
<jackson-databind.version>2.14.2</jackson-databind.version>
<ok2curl.version>0.8.0</ok2curl.version>
Expand Down Expand Up @@ -69,7 +69,7 @@
<sonar.version>5.14.0.18788</sonar.version>
<sonar.maven.version>3.9.1.2184</sonar.maven.version>
<jacoco.version>0.8.8</jacoco.version>
<surefire-version>3.0.0-M9</surefire-version>
<surefire-version>3.0.0</surefire-version>
<nexus.version>1.6.13</nexus.version>
<maven.gpg.version>3.0.1</maven.gpg.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
Expand Down Expand Up @@ -210,7 +210,8 @@
<artifactId>log4j-api</artifactId>
<version>${log4j-api.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml -->
<!--
https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static com.github.wasiqb.boyka.enums.PlatformType.WEB;
import static com.github.wasiqb.boyka.enums.WaitStrategy.CLICKABLE;
import static com.github.wasiqb.boyka.enums.WaitStrategy.VISIBLE;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.handleAndThrow;
import static java.text.MessageFormat.format;
import static java.time.Duration.ofMillis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static com.github.wasiqb.boyka.enums.Message.ERROR_EXECUTING_REQUEST;
import static com.github.wasiqb.boyka.enums.Message.ERROR_PARSING_REQUEST_BODY;
import static com.github.wasiqb.boyka.enums.Message.ERROR_PARSING_RESPONSE_BODY;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.handleAndThrow;
import static com.github.wasiqb.boyka.utils.SettingUtils.loadSetting;
import static com.github.wasiqb.boyka.utils.StringUtils.interpolate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static com.github.wasiqb.boyka.actions.drivers.DriverActions.withDriver;
import static com.github.wasiqb.boyka.enums.ApplicationType.HYBRID;
import static com.github.wasiqb.boyka.enums.Message.CONTEXT_SWITCHING_NOT_ALLOWED;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.throwError;
import static org.apache.logging.log4j.LogManager.getLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.wasiqb.boyka.actions.CommonActions.performDriverAction;
import static com.github.wasiqb.boyka.enums.Message.ERROR_CREATING_LOGS;
import static com.github.wasiqb.boyka.enums.Message.ERROR_WRITING_LOGS;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.handleAndThrow;
import static java.lang.System.getProperty;
import static java.lang.Thread.currentThread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.wasiqb.boyka.actions.CommonActions.performDriverAction;
import static com.github.wasiqb.boyka.enums.Message.DRIVER_CANNOT_BE_NULL;
import static com.github.wasiqb.boyka.enums.Message.ERROR_SAVING_SCREENSHOT;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.handleAndThrow;
import static com.github.wasiqb.boyka.utils.ErrorHandler.requireNonNull;
import static com.google.common.truth.Truth.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.wasiqb.boyka.actions.elements.ElementFinder.find;
import static com.github.wasiqb.boyka.enums.PlatformType.WEB;
import static com.github.wasiqb.boyka.enums.WaitStrategy.CLICKABLE;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static org.apache.logging.log4j.LogManager.getLogger;

import com.github.wasiqb.boyka.actions.interfaces.elements.IClickableActions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.wasiqb.boyka.actions.CommonActions.performElementAction;
import static com.github.wasiqb.boyka.actions.drivers.DriverActions.withDriver;
import static com.github.wasiqb.boyka.enums.PlatformType.WEB;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.google.common.truth.Truth.assertThat;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.logging.log4j.LogManager.getLogger;
Expand Down Expand Up @@ -168,6 +168,6 @@ public StringSubject verifyText () {
LOGGER.traceEntry ();
LOGGER.info ("Verifying text of {}", this.locator.getName ());
LOGGER.traceExit ();
return assertThat (getText ());
return assertThat (getText ().trim ());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.github.wasiqb.boyka.actions.elements;

import static com.github.wasiqb.boyka.enums.Message.ELEMENT_NOT_FOUND;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.handleAndThrow;
import static com.github.wasiqb.boyka.utils.ErrorHandler.throwError;
import static java.text.MessageFormat.format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.wasiqb.boyka.actions.CommonActions.getElementAttribute;
import static com.github.wasiqb.boyka.actions.CommonActions.performMobileGestures;
import static com.github.wasiqb.boyka.enums.Message.ELEMENT_NOT_FOUND;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.throwError;
import static java.util.Collections.singletonList;
import static org.apache.logging.log4j.LogManager.getLogger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static com.github.wasiqb.boyka.enums.Message.ELEMENT_CANNOT_BE_NULL;
import static com.github.wasiqb.boyka.enums.Message.INVALID_SWIPE_DISTANCE;
import static com.github.wasiqb.boyka.enums.SwipeDirection.DOWN;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.requireNonNull;
import static com.github.wasiqb.boyka.utils.ErrorHandler.throwError;
import static java.time.Duration.ZERO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static com.github.wasiqb.boyka.enums.Message.NO_KEYBOARD_ERROR;
import static com.github.wasiqb.boyka.enums.PlatformType.IOS;
import static com.github.wasiqb.boyka.enums.PlatformType.WEB;
import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;
import static com.github.wasiqb.boyka.utils.ErrorHandler.throwError;
import static java.util.Arrays.stream;
import static org.apache.logging.log4j.LogManager.getLogger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.github.wasiqb.boyka.builders;

import static com.github.wasiqb.boyka.sessions.ParallelSession.getSession;
import static com.github.wasiqb.boyka.manager.ParallelSession.getSession;

import java.util.function.Predicate;

Expand Down
Loading

0 comments on commit 4cd8c21

Please sign in to comment.