Skip to content

Commit

Permalink
added JioMeet tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbagmar committed Sep 27, 2022
1 parent 4557327 commit 52183c3
Show file tree
Hide file tree
Showing 21 changed files with 1,142 additions and 2 deletions.
31 changes: 31 additions & 0 deletions configs/jiomeet_browserstack_config.properties
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
23 changes: 23 additions & 0 deletions configs/jiomeet_local_config.properties
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
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();
}
}
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;
}
}
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();
}
}
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
public class SAMPLE_TEST_CONTEXT
extends TEST_CONTEXT {
public static final String ME = "me";
public static final String MEETING_ID = "meetingId";
public static final String MEETING_PASSWORD = "meetingPassword";
public static final String INVITATION_LINK = "invitationLink";
}
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);
}
}
Loading

0 comments on commit 52183c3

Please sign in to comment.