Skip to content

Commit

Permalink
all_Automation_Git_Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKadam-Tekdi committed Jul 9, 2024
1 parent c311d0c commit 3e10ea5
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 6 deletions.
6 changes: 6 additions & 0 deletions allAutomation/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions allAutomation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@
<version>4.0.0-alpha-5</version>
</dependency>


<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.33.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.33.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-drive -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-drive</artifactId>
<version>v3-rev197-1.25.0</version>
</dependency>


<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
Expand Down
Binary file modified allAutomation/src/main/java/Pages/output_audio.wav.wav
Binary file not shown.
8 changes: 3 additions & 5 deletions allAutomation/src/main/java/Tests/AllTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ public static void Login() throws Exception {

// Allocate the chosen voice
voice.allocate();
voice.speak(Text);


// Ensure the directory exists
String directoryPath = "src/main/java/Pages"; // Adjust this path as needed
Expand Down Expand Up @@ -324,17 +326,13 @@ public static void Login() throws Exception {
saveBase64ToFile(base64FilePath, base64Audio);
System.out.println("Base64 Audio saved successfully at: " + base64FilePath);


// driver.findElement(By.xpath("//*[@fill='url(#paint0_linear_400_1340)']")).sendKeys("https://all-dev-content-service.s3.ap-south-1.amazonaws.com/all-audio-files/en/44983c9c-48d4-4605-8e03-f7ae3932ad3e.wav");

// driver.findElement(By.xpath("//*[@fill='url(#paint0_linear_400_1340)']")).sendKeys("https://all-dev-content-service.s3.ap-south-1.amazonaws.com/all-audio-files/en/44983c9c-48d4-4605-8e03-f7ae3932ad3e.wav");
Thread.sleep(4000);
driver.findElement(By.xpath("(//*[@xmlns='http://www.w3.org/2000/svg'])[2]")).click();

String audioFilePath = "output.mp3";

// convertTextToSpeech(Text,audioFilePath);


}


Expand Down
83 changes: 82 additions & 1 deletion allAutomation/src/main/java/utils/baseutils/BrowserManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Properties;


public class BrowserManager extends BaseUtils {
/*public class BrowserManager extends BaseUtils {
static String locatorsPath = System.getProperty("user.dir") + "/src/test/java/test/resources/locators/";
static {
PropertiesFileManager.getInstance().setPath(locatorsPath);
Expand All @@ -39,6 +39,87 @@ public static void readEnvironment(String envFilePath) {
}
public static void browserRun() throws Exception {
FileReader fr = new FileReader(System.getProperty("user.dir") + "/src/test/java/test/resources/Test_data/browserConfig.properties");
Properties prop = new Properties();
prop.load(fr);
if (prop.getProperty("Browser").equalsIgnoreCase("chrome")) {
ChromeOptions opt = new ChromeOptions();
//opt.setHeadless(true);
opt.addArguments("--remote-allow-origins=*");
opt.addArguments("--incognito");
opt.addArguments("--use-fake-ui-for-media-stream");
// opt.setBrowserVersion("116");
driver = new ChromeDriver(opt);
} else if (prop.getProperty("Browser").equalsIgnoreCase("firefox")) {
FirefoxOptions opt = new FirefoxOptions();
opt.setBinary("/usr/bin/firefox");
driver = new FirefoxDriver(opt);
} else if (prop.getProperty("Browser").equalsIgnoreCase("edge")) {
EdgeOptions opt = new EdgeOptions();
opt.addArguments("--remote-allow-origins=*");
driver = new EdgeDriver();
} else {
System.out.println("Invalid Browser Selection");
}
driver.manage().window().maximize();
readEnvironment(envFilePath);
switch (environment)
{
case "QA" : driver.get("https://d114esnbvw5tst.cloudfront.net/");
case "DEV" : driver.get("https://d114esnbvw5tst.cloudfront.net/");
// case "PROD" : driver.get(prop.getProperty("PROD_URL"));
}
}
public static void main(String[] args) throws Exception {
browserRun();
}
}*/




public class BrowserManager extends BaseUtils {
static String locatorsPath = System.getProperty("user.dir") + "/src/test/java/test/resources/locators/";
static {
PropertiesFileManager.getInstance().setPath(locatorsPath);
}

private static String environment;
static String envFilePath = "src/test/ENV.properties";
public static void readEnvironment(String envFilePath) {
try {
byte[] encoded = Files.readAllBytes(Paths.get(envFilePath));
environment = new String(encoded).trim();
} catch (IOException e) {
System.out.println("Error reading the file: " + e.getMessage());
System.out.println("Error reading the file: " + e.getMessage());

}
}


public static void browserRun() throws Exception {

FileReader fr = new FileReader(System.getProperty("user.dir") + "/src/test/java/test/resources/Test_data/browserConfig.properties");
Expand Down
Binary file modified allAutomation/target/classes/Tests/AllTest.class
Binary file not shown.
Binary file modified allAutomation/target/classes/utils/baseutils/BrowserManager.class
Binary file not shown.

0 comments on commit 3e10ea5

Please sign in to comment.