Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(java): 🐛 fixed issue in multi user sessions #735

Merged
merged 4 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body:
attributes:
label: Issue Version
description: 🔢 What version of the framework is this bug related to?
placeholder: v0.20.1
placeholder: v0.21.0
validations:
required: true

Expand Down
6 changes: 3 additions & 3 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.20.1">
<img src="https://img.shields.io/github/downloads/BoykaFramework/boyka-framework/v0.20.1/total?color=brightgreen&label=Downloads%20for%20v0.20.1&logo=GitHub&style=for-the-badge" alt="GitHub releases" />
<a href="https://github.com/BoykaFramework/boyka-framework/releases/tag/v0.21.0">
<img src="https://img.shields.io/github/downloads/BoykaFramework/boyka-framework/v0.21.0/total?color=brightgreen&label=Downloads%20for%20v0.21.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 @@ -90,7 +90,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.20.1</version>
<version>0.21.0</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static java.lang.ThreadLocal.withInitial;
import static java.util.Optional.ofNullable;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.logging.log4j.LogManager.getLogger;

import java.util.HashMap;
Expand Down Expand Up @@ -97,7 +98,7 @@ public static synchronized void createSession (final String persona, final Platf
final var previousPersona = getCurrentPersona ();
switchPersona (persona);
checkSession ();
overrideSession (previousPersona);
overrideEmptySession (previousPersona);
final var currentSession = getSession ();
currentSession.setPlatformType (platformType);
currentSession.setConfigKey (configKey);
Expand Down Expand Up @@ -188,9 +189,9 @@ private static void checkSession () {
}
}

private static void overrideSession (final String previousPersona) {
private static void overrideEmptySession (final String previousPersona) {
final var session = SESSION.get ();
if (session.containsKey (previousPersona)) {
if (isEmpty (previousPersona) && session.containsKey (previousPersona)) {
final var previousSession = session.remove (previousPersona);
session.put (getCurrentPersona (), previousSession);
}
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-mobile-bs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Mobile BrowserStack Suite" verbose="2">
<suite name="Boyka Mobile BrowserStack Suite" verbose="2" parallel="tests">
<test name="Test Boyka Mobile app on BrowserStack Android Device">
<parameter name="platformType" value="ANDROID"/>
<parameter name="driverKey" value="test_bs_android"/>
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-mobile-local.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
~ copies or substantial portions of the Software.
-->
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Mobile Local Suite" verbose="2">
<suite name="Boyka Mobile Local Suite" verbose="2" parallel="tests">
<test name="Test Boyka Mobile on Local Android Emulator WDIO">
<parameter name="platformType" value="ANDROID"/>
<parameter name="driverKey" value="test_local_wdio_android"/>
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-mobile-lt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Mobile LambdaTest Suite" verbose="2">
<suite name="Boyka Mobile LambdaTest Suite" verbose="2" parallel="tests">
<test name="Test Boyka Mobile app on LambdaTest Android Device">
<parameter name="platformType" value="ANDROID"/>
<parameter name="driverKey" value="test_lt_android"/>
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-others.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Others Suite" verbose="2">
<suite name="Boyka Others Suite" verbose="2" parallel="classes">
<test name="Test Boyka others">
<packages>
<package name="com.github.wasiqb.boyka.testng.others"/>
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-web-bs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Web BrowserStack Suite" verbose="2">
<suite name="Boyka Web BrowserStack Suite" verbose="2" parallel="classes">
<test name="Test Boyka web on BrowserStack">
<parameter name="platformType" value="WEB"/>
<parameter name="driverKey" value="test_browserstack_chrome"/>
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-web-grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Web Grid Suite" verbose="2">
<suite name="Boyka Web Grid Suite" verbose="2" parallel="tests">
<test name="Test Boyka web on Selenium Grid">
<parameter name="platformType" value="WEB"/>
<parameter name="driverKey" value="test_selenium_grid"/>
Expand Down
4 changes: 2 additions & 2 deletions core-java/test-suites/testng-web-local.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Web Local Suite" verbose="2">
<suite name="Boyka Web Local Suite" verbose="2" parallel="classes">
<test name="Test Boyka web on Local Chrome">
<parameter name="platformType" value="WEB"/>
<parameter name="driverKey" value="test_local_chrome"/>
<packages>
<package name="com.github.wasiqb.boyka.testng.ui.saucedemo"/>
<package name="com.github.wasiqb.boyka.testng.ui.theinternet"/>
<!-- <package name="com.github.wasiqb.boyka.testng.ui.jiomeet"/>-->
<package name="com.github.wasiqb.boyka.testng.ui.jiomeet"/>
</packages>
</test>
<test name="Test Boyka web on Local Firefox" enabled="false">
Expand Down
2 changes: 1 addition & 1 deletion core-java/test-suites/testng-web-lt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Boyka Web LambdaTest Suite" verbose="2">
<suite name="Boyka Web LambdaTest Suite" verbose="2" parallel="classes">
<test name="Test Boyka web on LambdaTest">
<parameter name="platformType" value="WEB"/>
<parameter name="driverKey" value="test_lambda_test_chrome"/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boyka-framework",
"version": "0.20.1",
"version": "0.21.0",
"description": "Ultimate Automation framework to handle automation of Web, Mobile and API applications.",
"author": {
"name": "Wasiq Bhamla",
Expand Down
Loading
Loading