forked from znsio/teswiz
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4557327
commit 52183c3
Showing
21 changed files
with
1,142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
RUNNER=distribute | ||
FRAMEWORK=cucumber | ||
RUNNER_LEVEL=methods | ||
CAPS=./caps/jiomeet_browserstack_capabilities.json | ||
APP_NAME=teswiz | ||
APP_PACKAGE_NAME=com.jio.rilconferences | ||
APPLITOOLS_CONFIGURATION=./configs/applitools_config.json | ||
BASE_URL_FOR_WEB=JIOMEET_BASE_URL | ||
BROWSER=chrome | ||
BUILD_ID=BUILDID | ||
CLOUD_USER=browserstack_username | ||
CLOUD_KEY=browserstack_accesskey | ||
CLOUD_UPLOAD_APP=true | ||
CLOUD_NAME=browserstack | ||
DEVICE_LAB_URL=https://hub.browserstack.com | ||
ENVIRONMENT_CONFIG_FILE=./src/test/resources/environments.json | ||
IS_VISUAL=false | ||
LOG_DIR=target | ||
LOG_PROPERTIES_FILE=./src/test/resources/log4j.properties | ||
PARALLEL=1 | ||
PLATFORM=android | ||
PROXY_KEY=HTTP_PROXY | ||
WEBDRIVER_MANAGER_PROXY_KEY=HTTP_PROXY | ||
REPORT_PORTAL_FILE=src/test/resources/reportportal.properties | ||
REMOTE_WEBDRIVER_GRID_PORT=GRID_PORT | ||
RUN_IN_CI=true | ||
TARGET_ENVIRONMENT=prod | ||
TEST_DATA_FILE=./src/test/resources/testData.json | ||
MAX_NUMBER_OF_APPIUM_DRIVERS=5 | ||
MAX_NUMBER_OF_WEB_DRIVERS=5 | ||
BROWSER_CONFIG_FILE=./configs/browser_config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
RUNNER=distribute | ||
FRAMEWORK=cucumber | ||
RUNNER_LEVEL=methods | ||
CAPS=./caps/jiomeet_local_capabilities.json | ||
APP_NAME=JioMeet | ||
APP_PACKAGE_NAME=com.jio.rilconferences | ||
APPLITOOLS_CONFIGURATION=./configs/applitools_config.json | ||
BASE_URL_FOR_WEB=JIOMEET_BASE_URL | ||
BROWSER=chrome | ||
ENVIRONMENT_CONFIG_FILE=./src/test/resources/environments.json | ||
IS_VISUAL=true | ||
LOG_DIR=target | ||
LOG_PROPERTIES_FILE=./src/test/resources/log4j.properties | ||
PARALLEL=1 | ||
PLATFORM=android | ||
PROXY_KEY=HTTP_PROXY | ||
REPORT_PORTAL_FILE=src/test/resources/reportportal.properties | ||
RUN_IN_CI=false | ||
TARGET_ENVIRONMENT=prod | ||
LAUNCH_NAME_SUFFIX= on 'prod' Environment | ||
TEST_DATA_FILE=./src/test/resources/testData.json | ||
CLEANUP_DEVICE_BEFORE_STARTING_EXECUTION=false | ||
BROWSER_CONFIG_FILE=./configs/browser_config.json |
64 changes: 64 additions & 0 deletions
64
src/test/java/com/znsio/sample/e2e/businessLayer/jiomeet/AuthBL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.znsio.sample.e2e.businessLayer.jiomeet; | ||
|
||
import com.context.TestExecutionContext; | ||
import com.znsio.e2e.entities.Platform; | ||
import com.znsio.e2e.runner.Runner; | ||
import com.znsio.sample.e2e.entities.SAMPLE_TEST_CONTEXT; | ||
import com.znsio.sample.e2e.screen.jiomeet.SignInScreen; | ||
import org.apache.log4j.Logger; | ||
import org.assertj.core.api.SoftAssertions; | ||
|
||
import java.util.Map; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class AuthBL { | ||
private static final Logger LOGGER = Logger.getLogger(AuthBL.class.getName()); | ||
private final TestExecutionContext context; | ||
private final SoftAssertions softly; | ||
private final String currentUserPersona; | ||
private final Platform currentPlatform; | ||
|
||
public AuthBL(String userPersona, Platform forPlatform) { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = userPersona; | ||
this.currentPlatform = forPlatform; | ||
Runner.setCurrentDriverForUser(userPersona, forPlatform, context); | ||
} | ||
|
||
public AuthBL() { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = SAMPLE_TEST_CONTEXT.ME; | ||
this.currentPlatform = Runner.platform; | ||
} | ||
|
||
public LandingBL signIn(Map userDetails) { | ||
String username = String.valueOf(userDetails.get("username")); | ||
String password = String.valueOf(userDetails.get("password")); | ||
String firstName = String.valueOf(userDetails.get("firstName")); | ||
String lastName = String.valueOf(userDetails.get("lastName")); | ||
String expectedWelcomeMessageAndroid = "Hello " + firstName + " \n" + "what would you like to do?"; | ||
String expectedWelcomeMessageWeb = "Hello " + firstName + " " + lastName + ", what would you like to do?"; | ||
String expectedWelcomeMessage = currentPlatform.equals(Platform.web) ? expectedWelcomeMessageWeb : expectedWelcomeMessageAndroid; | ||
|
||
String signedInWelcomeMessage = SignInScreen.get() | ||
.signIn(username, password) | ||
.getSignedInWelcomeMessage(); | ||
|
||
LOGGER.info(String.format("signedInWelcomeMessage: '%s'", signedInWelcomeMessage)); | ||
|
||
assertThat(signedInWelcomeMessage).as("Welcome message is incorrect") | ||
.isEqualTo(expectedWelcomeMessage); | ||
return new LandingBL(currentUserPersona, currentPlatform); | ||
} | ||
|
||
public InAMeetingBL signInAndStartMeeting(Map userPersona) { | ||
return signIn(userPersona).startInstantMeeting(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/test/java/com/znsio/sample/e2e/businessLayer/jiomeet/InAMeetingBL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.znsio.sample.e2e.businessLayer.jiomeet; | ||
|
||
import com.context.TestExecutionContext; | ||
import com.znsio.e2e.entities.Platform; | ||
import com.znsio.e2e.runner.Runner; | ||
import com.znsio.sample.e2e.entities.SAMPLE_TEST_CONTEXT; | ||
import com.znsio.sample.e2e.screen.jiomeet.InAMeetingScreen; | ||
import org.apache.log4j.Logger; | ||
import org.assertj.core.api.SoftAssertions; | ||
|
||
public class InAMeetingBL { | ||
private static final Logger LOGGER = Logger.getLogger(InAMeetingBL.class.getName()); | ||
private final TestExecutionContext context; | ||
private final SoftAssertions softly; | ||
private final String currentUserPersona; | ||
private final Platform currentPlatform; | ||
|
||
public InAMeetingBL(String userPersona, Platform forPlatform) { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = userPersona; | ||
this.currentPlatform = forPlatform; | ||
Runner.setCurrentDriverForUser(userPersona, forPlatform, context); | ||
} | ||
|
||
public InAMeetingBL() { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = SAMPLE_TEST_CONTEXT.ME; | ||
this.currentPlatform = Runner.platform; | ||
} | ||
|
||
public InAMeetingBL unmuteMyself() { | ||
InAMeetingScreen.get() | ||
.unmute(); | ||
return this; | ||
} | ||
|
||
|
||
public InAMeetingBL muteMyself() { | ||
InAMeetingScreen.get() | ||
.mute(); | ||
return this; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/test/java/com/znsio/sample/e2e/businessLayer/jiomeet/JoinAMeetingBL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.znsio.sample.e2e.businessLayer.jiomeet; | ||
|
||
import com.context.TestExecutionContext; | ||
import com.znsio.e2e.entities.Platform; | ||
import com.znsio.e2e.runner.Runner; | ||
import com.znsio.sample.e2e.entities.SAMPLE_TEST_CONTEXT; | ||
import com.znsio.sample.e2e.screen.jiomeet.SignInScreen; | ||
import org.apache.log4j.Logger; | ||
import org.assertj.core.api.SoftAssertions; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class JoinAMeetingBL { | ||
private static final Logger LOGGER = Logger.getLogger(JoinAMeetingBL.class.getName()); | ||
private final TestExecutionContext context; | ||
private final SoftAssertions softly; | ||
private final String currentUserPersona; | ||
private final Platform currentPlatform; | ||
|
||
public JoinAMeetingBL(String userPersona, Platform forPlatform) { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = userPersona; | ||
this.currentPlatform = forPlatform; | ||
Runner.setCurrentDriverForUser(userPersona, forPlatform, context); | ||
} | ||
|
||
public JoinAMeetingBL() { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = SAMPLE_TEST_CONTEXT.ME; | ||
this.currentPlatform = Runner.platform; | ||
} | ||
|
||
public InAMeetingBL joinMeeting(String meetingId, String meetingPassword) { | ||
boolean hasMeetingStarted = SignInScreen.get() | ||
.joinAMeeting(meetingId, meetingPassword, currentUserPersona) | ||
.isMeetingStarted(); | ||
assertThat(hasMeetingStarted).as(currentUserPersona + " not yet joined the meeting") | ||
.isTrue(); | ||
return new InAMeetingBL(); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/test/java/com/znsio/sample/e2e/businessLayer/jiomeet/LandingBL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.znsio.sample.e2e.businessLayer.jiomeet; | ||
|
||
import com.context.TestExecutionContext; | ||
import com.znsio.e2e.entities.Platform; | ||
import com.znsio.e2e.runner.Runner; | ||
import com.znsio.sample.e2e.entities.SAMPLE_TEST_CONTEXT; | ||
import com.znsio.sample.e2e.screen.jiomeet.InAMeetingScreen; | ||
import com.znsio.sample.e2e.screen.jiomeet.LandingScreen; | ||
import org.apache.log4j.Logger; | ||
import org.assertj.core.api.SoftAssertions; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class LandingBL { | ||
private static final Logger LOGGER = Logger.getLogger(LandingBL.class.getName()); | ||
private final TestExecutionContext context; | ||
private final SoftAssertions softly; | ||
private final String currentUserPersona; | ||
private final Platform currentPlatform; | ||
|
||
public LandingBL(String userPersona, Platform forPlatform) { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = userPersona; | ||
this.currentPlatform = forPlatform; | ||
Runner.setCurrentDriverForUser(userPersona, forPlatform, context); | ||
} | ||
|
||
public LandingBL() { | ||
long threadId = Thread.currentThread() | ||
.getId(); | ||
this.context = Runner.getTestExecutionContext(threadId); | ||
softly = Runner.getSoftAssertion(threadId); | ||
this.currentUserPersona = SAMPLE_TEST_CONTEXT.ME; | ||
this.currentPlatform = Runner.platform; | ||
} | ||
|
||
public InAMeetingBL startInstantMeeting() { | ||
InAMeetingScreen inAMeetingScreen = LandingScreen.get() | ||
.startInstantMeeting(); | ||
boolean hasMeetingStarted = inAMeetingScreen.isMeetingStarted(); | ||
assertThat(hasMeetingStarted).as("Meeting should have been started") | ||
.isTrue(); | ||
String meetingId = inAMeetingScreen.getMeetingId(); | ||
String meetingPassword = inAMeetingScreen.getMeetingPassword(); | ||
LOGGER.info(String.format("Meeting id: '%s', password: '%s'", meetingId, meetingPassword)); | ||
context.addTestState(SAMPLE_TEST_CONTEXT.MEETING_ID, meetingId); | ||
context.addTestState(SAMPLE_TEST_CONTEXT.MEETING_PASSWORD, meetingPassword); | ||
return new InAMeetingBL(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/test/java/com/znsio/sample/e2e/exceptions/jiomeet/InAMeetingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.znsio.sample.e2e.exceptions.jiomeet; | ||
|
||
public class InAMeetingException | ||
extends RuntimeException { | ||
public InAMeetingException(String message) { | ||
super(message); | ||
} | ||
|
||
public InAMeetingException(String message, Exception e) { | ||
super(message, e); | ||
} | ||
} |
Oops, something went wrong.