Commit 5d3dd9ba authored by mrahim's avatar mrahim

bwt web automation

parent a52e5901
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JpaBuddyIdeaProjectConfig">
<option name="renamerInitialized" value="true" />
</component>
</project>
\ No newline at end of file
...@@ -11,4 +11,7 @@ ...@@ -11,4 +11,7 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="azul-1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="azul-1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="ProjectType">
<option name="id" value="jpab" />
</component>
</project> </project>
\ No newline at end of file
...@@ -5,14 +5,40 @@ ...@@ -5,14 +5,40 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c3a7bc8b-2204-42f3-aa01-260d573e34da" name="Changes" comment=""> <list default="true" id="c3a7bc8b-2204-42f3-aa01-260d573e34da" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" /> <change afterPath="$PROJECT_DIR$/.idea/jpa-buddy.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/test/java/com/example/utils/DriverManager.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/AddToCart.feature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/test/resources/global.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" />
<change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/org/example/Main.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/AddToCartSteps.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/org/example/Main.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/chromedriver" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/resources/chromedriver" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/global.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/FailedTestRunner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/FailedTestRunner.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/AddToCartPage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/AddToCartPage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/BayanatPage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/BayanatPage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/HomePage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/HomePage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/PagesObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/PagesObject.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/PublicationPage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/PublicationPage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/PageObjects/WelfarePage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/WelfarePage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/AddToCartSteps.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/AddToCartSteps.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/BayanatsPageSteps.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/BayanatsPageSteps.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/HomePageSteps.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/HomePageSteps.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/Hooks.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/Hooks.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/PublicationPageSteps.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/PublicationPageSteps.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/StepDefinations/WelfarePageSteps.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/WelfarePageSteps.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/TestRunner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/TestRunnerPk.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/Utils/BaseClass.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/example/Utils/TextContextSetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/example/utils/TextContextSetup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/AddToCart.feature" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/BayanatPage.feature" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/BayanatPage.feature" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/EducationPage.feature" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/EducationPage.feature" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/HomePage.feature" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/HomePage.feature" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/PublicationPage.feature" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/PublicationPage.feature" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/resources/Feature/WelfarePage.feature" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/features/pakistan/WelfarePage.feature" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testng.xml" beforeDir="false" afterPath="$PROJECT_DIR$/testng.xml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -30,11 +56,10 @@ ...@@ -30,11 +56,10 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/src/main/java/org/example/Main.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/test/java/com/example/TestRunnerPk.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/test/java/com/example/PageObjects/AddToCartPage.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/test/java/com/example/pageobjects/pakistan/AddToCartPage.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/test/java/com/example/StepDefinations/AddToCartSteps.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/test/java/com/example/stepdefinations/pakistan/AddToCartSteps.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/test/java/com/example/TestRunner.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/test/java/features/pakistan/AddToCart.feature" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/test/resources/Feature/AddToCart.feature" root0="FORCE_HIGHLIGHTING" />
</component> </component>
<component name="MarkdownSettingsMigration"> <component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" /> <option name="stateVersion" value="1" />
...@@ -45,31 +70,40 @@ ...@@ -45,31 +70,40 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;, "SHARE_PROJECT_CONFIGURATION_FILES": "true",
&quot;last_opened_file_path&quot;: &quot;/Users/mrahim/Desktop/BiatussalamPakistanAutomation/src/main/resources&quot; "last_opened_file_path": "/Users/mrahim/Desktop/bwt-web-pk-usa"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/test/resources" />
<recent name="$PROJECT_DIR$/src/test/java" />
<recent name="$PROJECT_DIR$/src/main/resources" /> <recent name="$PROJECT_DIR$/src/main/resources" />
</key> </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/test/resources" />
<recent name="$PROJECT_DIR$/src/test/java/features/usa" />
<recent name="$PROJECT_DIR$/src/test/java/features/pakistan" />
</key>
<key name="CopyClassDialog.RECENTS_KEY"> <key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.example.Utils" />
<recent name="com.example" /> <recent name="com.example" />
</key> </key>
</component> </component>
<component name="RunManager" selected="TestNG.TestRunner"> <component name="RunManager" selected="TestNG.TestRunnerPk (2)">
<configuration name="Feature: AddToCart" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true"> <configuration name="Scenario: User should be able to search for publication" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true">
<option name="CUCUMBER_CORE_VERSION" value="5" /> <option name="CUCUMBER_CORE_VERSION" value="5" />
<option name="FILE_PATH" value="$PROJECT_DIR$/src/test/resources/Feature/AddToCart.feature" /> <option name="FILE_PATH" value="$PROJECT_DIR$/src/test/java/features/pakistan/PublicationPage.feature" />
<option name="GLUE" value="com.example.StepDefinations" /> <option name="GLUE" value="com.example.stepdefinations.usa com.example.stepdefinations.pakistan" />
<option name="MAIN_CLASS_NAME" value="io.cucumber.core.cli.Main" /> <option name="MAIN_CLASS_NAME" value="io.cucumber.core.cli.Main" />
<module name="WebTest" /> <module name="bwt-web-pk-usa 2" />
<option name="PROGRAM_PARAMETERS" value=" --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter" /> <option name="NAME_FILTER" value="^User should be able to search for publication$" />
<option name="SUGGESTED_NAME" value="Feature: AddToCart" /> <option name="PROGRAM_PARAMETERS" value=" --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name &quot;^User should be able to search for publication$&quot;" />
<option name="SUGGESTED_NAME" value="Scenario: User should be able to search for publication" />
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" /> <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
...@@ -81,67 +115,76 @@ ...@@ -81,67 +115,76 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Feature: PublicationPage" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true"> <configuration name="FailedTestRunner" type="TestNG" temporary="true" nameIsGenerated="true">
<option name="CUCUMBER_CORE_VERSION" value="5" /> <module name="bwt-web-pk-usa 2" />
<option name="FILE_PATH" value="$PROJECT_DIR$/src/test/resources/Feature/PublicationPage.feature" />
<option name="GLUE" value="com.example.StepDefinations" />
<option name="MAIN_CLASS_NAME" value="io.cucumber.core.cli.Main" />
<module name="BiatussalamPakistanAutomation" />
<option name="PROGRAM_PARAMETERS" value=" --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter" />
<option name="SUGGESTED_NAME" value="Feature: PublicationPage" />
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="io.cucumber.core.cli.*" /> <option name="PATTERN" value="com.example.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
<option name="PACKAGE_NAME" value="com.example" />
<option name="MAIN_CLASS_NAME" value="com.example.FailedTestRunner" />
<option name="TEST_OBJECT" value="CLASS" />
<properties />
<listeners />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Scenario: To verify 1000-Monthly donation on Recurring Weekly basis is added to the cart" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true"> <configuration name="TestRunnerPk (2)" type="TestNG" temporary="true" nameIsGenerated="true">
<option name="CUCUMBER_CORE_VERSION" value="5" /> <module name="bwt-web-pk-usa 2" />
<option name="FILE_PATH" value="$PROJECT_DIR$/src/test/resources/Feature/WelfarePage.feature" />
<option name="GLUE" value="com.example.StepDefinations" />
<option name="MAIN_CLASS_NAME" value="io.cucumber.core.cli.Main" />
<module name="BiatussalamPakistanAutomation" />
<option name="NAME_FILTER" value="^To verify 1000\-Monthly donation on Recurring Weekly basis is added to the cart$" />
<option name="PROGRAM_PARAMETERS" value=" --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name &quot;^To verify 1000\-Monthly donation on Recurring Weekly basis is added to the cart$&quot;" />
<option name="SUGGESTED_NAME" value="Scenario: To verify 1000-Monthly donation on Recurring Weekly basis is added to the cart" />
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="io.cucumber.core.cli.*" /> <option name="PATTERN" value="com.example.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
<option name="PACKAGE_NAME" value="com.example" />
<option name="MAIN_CLASS_NAME" value="com.example.TestRunnerPk" />
<option name="TEST_OBJECT" value="CLASS" />
<properties />
<listeners />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Scenario: User should not be able to remove all the donation of 1000-Monthly Recurring donation to cart when remove the first donation to cart list" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true"> <configuration name="TestRunnerPk" type="TestNG" temporary="true" nameIsGenerated="true">
<option name="CUCUMBER_CORE_VERSION" value="5" /> <module name="BiatussalamAUtomationWork" />
<option name="FILE_PATH" value="$PROJECT_DIR$/src/test/resources/Feature/AddToCart.feature" />
<option name="GLUE" value="com.example.StepDefinations" />
<option name="MAIN_CLASS_NAME" value="io.cucumber.core.cli.Main" />
<module name="WebTest" />
<option name="NAME_FILTER" value="^User should not be able to remove all the donation of 1000\-Monthly Recurring donation to cart when remove the first donation to cart list$" />
<option name="PROGRAM_PARAMETERS" value=" --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name &quot;^User should not be able to remove all the donation of 1000\-Monthly Recurring donation to cart when remove the first donation to cart list$&quot;" />
<option name="SUGGESTED_NAME" value="Scenario: User should not be able to remove all the donation of 1000-Monthly Recurring donation to cart when remove the first donation to cart list" />
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="io.cucumber.core.cli.*" /> <option name="PATTERN" value="com.example.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
<option name="PACKAGE_NAME" value="com.example" />
<option name="MAIN_CLASS_NAME" value="com.example.TestRunnerPk" />
<option name="TEST_OBJECT" value="CLASS" />
<properties />
<listeners />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestRunnerUsa (1)" type="TestNG" temporary="true" nameIsGenerated="true">
<module name="Biatussalam_Pakistan_Usa_Website_Automation" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.example.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.example" />
<option name="MAIN_CLASS_NAME" value="com.example.TestRunnerUsa" />
<option name="TEST_OBJECT" value="CLASS" />
<properties />
<listeners />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="TestRunner" type="TestNG" temporary="true" nameIsGenerated="true"> <configuration name="TestRunnerUsa (2)" type="TestNG" temporary="true" nameIsGenerated="true">
<module name="WebTest" /> <module name="bwt-web-pk-usa 2" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="com.example.*" /> <option name="PATTERN" value="com.example.*" />
...@@ -149,7 +192,7 @@ ...@@ -149,7 +192,7 @@
</pattern> </pattern>
</extension> </extension>
<option name="PACKAGE_NAME" value="com.example" /> <option name="PACKAGE_NAME" value="com.example" />
<option name="MAIN_CLASS_NAME" value="com.example.TestRunner" /> <option name="MAIN_CLASS_NAME" value="com.example.TestRunnerUsa" />
<option name="TEST_OBJECT" value="CLASS" /> <option name="TEST_OBJECT" value="CLASS" />
<properties /> <properties />
<listeners /> <listeners />
...@@ -159,11 +202,11 @@ ...@@ -159,11 +202,11 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="TestNG.TestRunner" /> <item itemvalue="TestNG.TestRunnerPk (2)" />
<item itemvalue="Cucumber Java.Feature: PublicationPage" /> <item itemvalue="TestNG.TestRunnerUsa (2)" />
<item itemvalue="Cucumber Java.Scenario: To verify 1000-Monthly donation on Recurring Weekly basis is added to the cart" /> <item itemvalue="TestNG.FailedTestRunner" />
<item itemvalue="Cucumber Java.Scenario: User should not be able to remove all the donation of 1000-Monthly Recurring donation to cart when remove the first donation to cart list" /> <item itemvalue="Cucumber Java.Scenario: User should be able to search for publication" />
<item itemvalue="Cucumber Java.Feature: AddToCart" /> <item itemvalue="TestNG.TestRunnerUsa (1)" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
......
# baitussalam-web-pk-usa
Baitussalam Pakistan and usa Website atuomation
This automation scripts conatains Ui automation of baitussalam Pakistan and Usa
website
# Project structure:
Contains separate pacakages for Pakistan and Usa website work
features/: Gherkin feature files with test scenarios.
hooks/: Cucumber hooks.
runners/: Cucumber test runners.
stepdefinitions/: step definition classes.
transformations/: Cucumber
# Working:
Parallel test runs.
Shared state across cucumber step definitions.
Dependency injection.
Page Object pattern.
Commonly used test utility classes
# Tools:
Maven.
Cucumber-JVM
Testng
Selenium Webdriver
# Notes:
This application contains separate runner classes for Running baitussalam Pakistan
and baitussalam usa Website
# Installation requirement:
This program doesnot require and Installation however need to update the chrome
driver in resources file according to Running system chrome version in resources
file
# Reports:
Cucumber reports will generate in Cucumber-reports under target folder.
\ No newline at end of file
...@@ -20,12 +20,6 @@ ...@@ -20,12 +20,6 @@
<version>4.2.2</version> <version>4.2.2</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>org.testng</groupId>-->
<!-- <artifactId>testng</artifactId>-->
<!-- <version>7.6.0</version>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/org.testng/testng --> <!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
...@@ -71,6 +65,13 @@ ...@@ -71,6 +65,13 @@
<version>6.6.6</version> <version>6.6.6</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber7-jvm -->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>2.19.0</version>
</dependency>
</dependencies> </dependencies>
......
package org.example;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
\ No newline at end of file
browser=Chrome
Url=https://dev.baitussalam.org/
\ No newline at end of file
...@@ -10,7 +10,7 @@ import org.testng.annotations.DataProvider; ...@@ -10,7 +10,7 @@ import org.testng.annotations.DataProvider;
"json:target/cucumber-reports/cucumber.json" "json:target/cucumber-reports/cucumber.json"
}, },
features = {"@target/failed_scenario.txt"}, features = {"@target/failed_scenario.txt"},
glue = {"com.example.StepDefinations"}, glue = {"com.example.stepdefinations.pakistan"},
monochrome = true, monochrome = true,
tags = "@web" tags = "@web"
) )
......
...@@ -10,13 +10,15 @@ import org.testng.annotations.DataProvider; ...@@ -10,13 +10,15 @@ import org.testng.annotations.DataProvider;
"json:target/cucumber-reports/cucumber.json", "json:target/cucumber-reports/cucumber.json",
"rerun:target/failed_scenario.txt" "rerun:target/failed_scenario.txt"
}, },
features = {"src/test/resources/Feature/AddToCart.feature"}, features = {"src/test/java/features/pakistan/HomePage.feature"},
glue = {"com.example.StepDefinations"}, glue = {"com.example.stepdefinations.pakistan"},
monochrome = true, monochrome = true,
tags = "@web" tags = "@web"
) )
public class TestRunner extends AbstractTestNGCucumberTests { public class TestRunnerPk extends AbstractTestNGCucumberTests {
// For parallel execution of test cases
// @Override // @Override
// @DataProvider(parallel = true) // @DataProvider(parallel = true)
......
package com.example;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;
@CucumberOptions(
plugin = {"pretty",
"html:target/cucumber-reports/cucumber.html",
"json:target/cucumber-reports/cucumber.json",
"rerun:target/failed_scenario.txt"
},
features = {"src/test/java/features/usa/USA_Website.feature"},
glue = {"com.example.stepdefinations.usa"},
monochrome = true,
tags = "@web"
)
public class TestRunnerUsa extends AbstractTestNGCucumberTests {
// For parallel execution of test cases
// @Override
// @DataProvider(parallel = true)
// public Object [][] scenarios() {
// return super.scenarios();
// }
}
\ No newline at end of file
package com.example.Utils;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class BaseClass {
public WebDriver driver;
public WebDriver WebDriverManager() throws IOException {
FileInputStream fis=new FileInputStream(System.getProperty("user.dir")+"//src//main//resources//global.properties");
Properties prop=new Properties();
prop.load(fis);
String url=prop.getProperty("Url");
String browser_properties=prop.getProperty("browser");
String browser_maven=System.getProperty("browser");
String browser=browser_maven!=null ?browser_maven:browser_properties;
if(driver==null) {
if(browser.equalsIgnoreCase("chrome"))
{ //For chrome browser any other browser can add their
System.setProperty("webdriver.chrome.driver", "src/main/resources/chromedriver");
DesiredCapabilities caps = new DesiredCapabilities();
LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
driver = new ChromeDriver(caps);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
// if(browser.equalsIgnoreCase("firefox"))
// {
// System.setProperty("webdriver.gecko.driver", "src/main/resources/geckodriver");
// driver= new FirefoxDriver();
// driver.manage().window().maximize();
// }
driver.get(url);
}
return driver;
}
}
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import java.util.List;
public class AddToCartPage { public class AddToCartPage {
public WebDriver driver; public WebDriver driver;
public AddToCartPage(WebDriver driver) {
this.driver=driver;
}
// public List<WebElement> itemsInCartLocator= driver.findElements(By.cssSelector(".box-cart-item h4")); public AddToCartPage(WebDriver driver) {
// public List<WebElement> itemsInCart() { this.driver = driver;
// return driver.findElements(By.cssSelector(".box-cart-item h4")); }
// }
// public void text() {
// driver.findElement(By.cssSelector(".box-cart-item h4"));
// }
public void closePopup() { public void closePopup() {
driver.findElement(By.xpath("//button[@aria-label='Close']")).click(); driver.findElement(By.xpath("//button[@aria-label='Close']")).click();
...@@ -32,9 +24,10 @@ public class AddToCartPage { ...@@ -32,9 +24,10 @@ public class AddToCartPage {
driver.findElement(By.cssSelector("div:nth-child(3) div:nth-child(3) img:nth-child(1)")).click(); driver.findElement(By.cssSelector("div:nth-child(3) div:nth-child(3) img:nth-child(1)")).click();
} }
public void addItem() { public void addToCartItem(String items) {
driver.findElement(By.cssSelector("div:nth-child(6) > div:nth-child(2) a:nth-child(3) > p:nth-child(1)")).click(); driver.findElement(By.xpath(String.format("//p[normalize-space()='%s']/../../a[2]/p", items))).click();
} }
public void addItem2() { public void addItem2() {
driver.findElement(By.cssSelector("div:nth-child(6) > div:nth-child(5) > div > a:nth-child(3) > p")).click(); driver.findElement(By.cssSelector("div:nth-child(6) > div:nth-child(5) > div > a:nth-child(3) > p")).click();
} }
...@@ -50,33 +43,45 @@ public class AddToCartPage { ...@@ -50,33 +43,45 @@ public class AddToCartPage {
public WebElement donationAddedToCart(String text) { public WebElement donationAddedToCart(String text) {
return driver.findElement(By.xpath(String.format("//h4[contains(text(),'%s')]", text))); return driver.findElement(By.xpath(String.format("//h4[contains(text(),'%s')]", text)));
} }
public WebElement donationInCart(String text) { public WebElement donationInCart(String text) {
return driver.findElement(By.xpath(String.format("//h4[normalize-space()='%s']", text))); return driver.findElement(By.xpath(String.format("//h4[normalize-space()='%s']", text)));
} }
public void closeMessengerPopUp() throws InterruptedException { public void closeMessengerPopUp() throws InterruptedException {
Thread.sleep(8000); Thread.sleep(8000);
driver.findElement(By.cssSelector("#fb-root > div.fb_dialog.fb_dialog_advanced > div > iframe:nth-child(1)")).click(); driver.findElement(By.cssSelector("#fb-root > div.fb_dialog.fb_dialog_advanced > div > iframe:nth-child(1)")).click();
} }
public WebElement removeDonation(String donation) {
return driver.findElement(By.xpath(String.format("(//button[normalize-space()='Remove'])['%s']",donation))); public WebElement removeDonation(String donation) {
return driver.findElement(By.xpath(String.format("(//button[normalize-space()='Remove'])['%s']", donation)));
} }
public String numberOfDonation() { public String numberOfDonation() {
return driver.findElement(By.cssSelector(".modal-body .no-of-cart-items")).getText().trim(); return driver.findElement(By.cssSelector(".modal-body .no-of-cart-items")).getText().trim();
} }
public WebElement pageHeader(String page) { public WebElement pageHeader(String page) {
return driver.findElement(By.xpath(String.format("//h2[normalize-space()='%s']",page))); return driver.findElement(By.xpath(String.format("//h2[normalize-space()='%s']", page)));
} }
public String DonationTotalAmountInCart() { public String DonationTotalAmountInCart() {
return driver.findElement(By.cssSelector("span.cart-amount")).getText(); return driver.findElement(By.cssSelector("span.cart-amount")).getText();
} }
public WebElement amountInCart(String amount) { public WebElement amountInCart(String amount) {
return driver.findElement(By.xpath(String.format("(//div[@class='col-xs-5 text-right'][normalize-space()='%s'])",amount))); return driver.findElement(By.xpath(String.format("(//div[@class='col-xs-5 text-right'][normalize-space()='%s'])", amount)));
}
public void amountAddedForDonationInCart(String amount) {
Select donationAmount = new Select(driver.findElement(By.xpath("//select[@name='amount']")));
donationAmount.selectByVisibleText(amount);
} }
// public void jsExecutor(String locator) {
// WebElement element = driver.findElement(By.xpath(String.format("//button[normalize-space()='%s']",locator))); public WebElement enterAmountForDonationInCart() {
// Actions actions = new Actions(driver); return driver.findElement(By.cssSelector("input[id='input_other_amount']"));
// actions.moveToElement(element).click().perform(); }
// }
} }
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -7,32 +7,42 @@ import org.openqa.selenium.WebElement; ...@@ -7,32 +7,42 @@ import org.openqa.selenium.WebElement;
public class BayanatPage { public class BayanatPage {
public WebDriver driver; public WebDriver driver;
public BayanatPage(WebDriver driver) {this.driver = driver;} public BayanatPage(WebDriver driver) {
this.driver = driver;
}
public WebElement firstNameFieldLocator() { public WebElement firstNameFieldLocator() {
return driver.findElement(By.cssSelector("input[name='first_name']")); return driver.findElement(By.cssSelector("input[name='first_name']"));
} }
public WebElement lastNameFieldLocator() { public WebElement lastNameFieldLocator() {
return driver.findElement(By.cssSelector("input[name='last_name']")); return driver.findElement(By.cssSelector("input[name='last_name']"));
} }
public WebElement emailFieldLocator() { public WebElement emailFieldLocator() {
return driver.findElement(By.xpath("//input[@id='form_email']")); return driver.findElement(By.xpath("//input[@id='form_email']"));
} }
public WebElement phoneFieldLocator() { public WebElement phoneFieldLocator() {
return driver.findElement(By.cssSelector("input[name='phone']")); return driver.findElement(By.cssSelector("input[name='phone']"));
} }
public WebElement addressFieldLocator() { public WebElement addressFieldLocator() {
return driver.findElement(By.cssSelector("input[name='address']")); return driver.findElement(By.cssSelector("input[name='address']"));
} }
public WebElement cityFieldLocator() { public WebElement cityFieldLocator() {
return driver.findElement(By.cssSelector("input[name='city']")); return driver.findElement(By.cssSelector("input[name='city']"));
} }
public WebElement countryFieldLocator() { public WebElement countryFieldLocator() {
return driver.findElement(By.cssSelector("input[name='country']")); return driver.findElement(By.cssSelector("input[name='country']"));
} }
public WebElement skillsFieldLocator() { public WebElement skillsFieldLocator() {
return driver.findElement(By.cssSelector("textarea[name='qualification']")); return driver.findElement(By.cssSelector("textarea[name='qualification']"));
} }
public WebElement volunteerExperienceFieldLocator() { public WebElement volunteerExperienceFieldLocator() {
return driver.findElement(By.cssSelector("textarea[name='experience']")); return driver.findElement(By.cssSelector("textarea[name='experience']"));
} }
......
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -6,37 +6,77 @@ import org.openqa.selenium.WebElement; ...@@ -6,37 +6,77 @@ import org.openqa.selenium.WebElement;
public class HomePage { public class HomePage {
public WebDriver driver; public WebDriver driver;
public HomePage(WebDriver driver) { public HomePage(WebDriver driver) {
this.driver=driver; this.driver = driver;
} }
public WebElement aboutUsButtonLocator() { public WebElement aboutUsButtonLocator() {
return driver.findElement(By.cssSelector("div.col-sm-3.text-center.box-about > a > img")); return driver.findElement(By.cssSelector("div.col-sm-3.text-center.box-about > a > img"));
} }
public WebElement timeLineButtonLocator() { public WebElement timeLineButtonLocator() {
return driver.findElement(By.cssSelector("div.col-sm-3.text-center.box-timeline > a > img")); return driver.findElement(By.cssSelector("div.col-sm-3.text-center.box-timeline > a > img"));
} }
public WebElement contactButtonLocator() { public WebElement contactButtonLocator() {
return driver.findElement(By.cssSelector("a:nth-child(2) > button")); return driver.findElement(By.cssSelector("a:nth-child(2) > button"));
} }
public WebElement featureLocator(Integer feature) { public WebElement featureLocator(Integer feature) {
return driver.findElement(By.cssSelector("body > div.container-fluid > div > div:nth-child("+feature+")")); return driver.findElement(By.cssSelector("body > div.container-fluid > div > div:nth-child(" + feature + ")"));
} }
public WebElement featureLearnMoreButtonLocator(String feature) { public WebElement featureLearnMoreButtonLocator(String feature) {
return driver.findElement(By.xpath(String.format("//a[@href='https://dev.baitussalam.org/%s']",feature))); return driver.findElement(By.xpath(String.format("//a[@href='https://dev.baitussalam.org/%s']", feature)));
} }
public WebElement bayanListLocator(String bayan) { public WebElement bayanListLocator(String bayan) {
return driver.findElement(By.xpath(String.format("(//h3[normalize-space()='%s'])",bayan))); return driver.findElement(By.xpath(String.format("(//h3[normalize-space()='%s'])", bayan)));
} }
public WebElement publicationListLocator(String publication) { public WebElement publicationListLocator(String publication) {
return driver.findElement(By.xpath(String.format("//span[normalize-space()='%s']",publication))); return driver.findElement(By.xpath(String.format("//span[normalize-space()='%s']", publication)));
} }
public WebElement educationProjectListLocator(String educationProject) { public WebElement educationProjectListLocator(String educationProject) {
return driver.findElement(By.xpath(String.format("//h5[normalize-space()='%s']",educationProject))); return driver.findElement(By.xpath(String.format("//h5[normalize-space()='%s']", educationProject)));
} }
public WebElement welfareProjectLocator(String bayan) { public WebElement welfareProjectLocator(String bayan) {
return driver.findElement(By.xpath(String.format("(//h3[normalize-space()='%s'])",bayan))); return driver.findElement(By.xpath(String.format("(//h3[normalize-space()='%s'])", bayan)));
}
public WebElement emailFieldForSubscription() {
return driver.findElement(By.cssSelector("input[name='email']"));
}
public WebElement successMessage() {
return driver.findElement(By.cssSelector("div[class='alert alert-success']"));
}
public WebElement socialMediaButton(String socialMedia) {
return driver.findElement(By.cssSelector(String.format("i[class='fab fa-%s']", socialMedia)));
}
public WebElement contactNameField() {
return driver.findElement(By.cssSelector("input[placeholder='Enter Name']"));
}
public WebElement contactEmailField() {
return driver.findElement(By.cssSelector("input[placeholder='Enter Email']"));
}
public WebElement contactSubjectField() {
return driver.findElement(By.cssSelector("input[placeholder='Enter Subject']"));
}
public WebElement contactPhoneField() {
return driver.findElement(By.cssSelector("input[placeholder='Enter Phone']"));
} }
public WebElement messageField() {
return driver.findElement(By.cssSelector("textarea[placeholder='Enter Message']"));
}
} }
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import com.example.pageobjects.usa.WebPage;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
public class PagesObject { public class PagesObject {
...@@ -8,35 +9,41 @@ public class PagesObject { ...@@ -8,35 +9,41 @@ public class PagesObject {
public HomePage homePage; public HomePage homePage;
public PublicationPage publicationPage; public PublicationPage publicationPage;
public BayanatPage bayanatPage; public BayanatPage bayanatPage;
public WebPage webPage;
public WebDriver driver; public WebDriver driver;
public PagesObject(WebDriver driver) public PagesObject(WebDriver driver) {
{ this.driver = driver;
this.driver=driver;
} }
public AddToCartPage getAddToCartPage(){ public AddToCartPage getAddToCartPage() {
addToCartPage=new AddToCartPage(driver); addToCartPage = new AddToCartPage(driver);
return addToCartPage; return addToCartPage;
} }
public WelfarePage getWelfarePage(){
welfarePage =new WelfarePage(driver); public WelfarePage getWelfarePage() {
welfarePage = new WelfarePage(driver);
return welfarePage; return welfarePage;
} }
public HomePage getHomePage(){ public HomePage getHomePage() {
homePage=new HomePage(driver); homePage = new HomePage(driver);
return homePage; return homePage;
} }
public PublicationPage getPublicationPage(){ public PublicationPage getPublicationPage() {
publicationPage=new PublicationPage(driver); publicationPage = new PublicationPage(driver);
return publicationPage; return publicationPage;
} }
public BayanatPage getBayanatPage(){ public BayanatPage getBayanatPage() {
bayanatPage=new BayanatPage(driver); bayanatPage = new BayanatPage(driver);
return bayanatPage; return bayanatPage;
} }
public WebPage getWebPage() {
webPage = new WebPage(driver);
return webPage;
}
} }
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -9,10 +9,12 @@ import org.openqa.selenium.support.ui.Select; ...@@ -9,10 +9,12 @@ import org.openqa.selenium.support.ui.Select;
public class PublicationPage { public class PublicationPage {
public WebDriver driver; public WebDriver driver;
public PublicationPage(WebDriver driver){this.driver = driver;} public PublicationPage(WebDriver driver) {
this.driver = driver;
}
public WebElement pageHeader(String pageHeader) { public WebElement pageHeader(String pageHeader) {
return driver.findElement(By.xpath(String.format("//a[normalize-space()='%s']", pageHeader))); return driver.findElement(By.xpath(String.format("//a[normalize-space()='%s']", pageHeader)));
} }
public void publicationType(String type) { public void publicationType(String type) {
...@@ -25,10 +27,10 @@ public class PublicationPage { ...@@ -25,10 +27,10 @@ public class PublicationPage {
} }
public WebElement searchButton() { public WebElement searchButton() {
return driver.findElement(By.cssSelector(".fa.fa-search")); return driver.findElement(By.cssSelector("button[class='btn search-button']"));
} }
public WebElement searchFieldLocator() { public WebElement searchFieldLocator() {
return driver.findElement(By.cssSelector("//input[@placeholder='Click to Search']")); return driver.findElement(By.xpath("//input[@placeholder='Click to Search']"));
} }
} }
package com.example.PageObjects; package com.example.pageobjects.pakistan;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
...@@ -207,7 +207,7 @@ public class WelfarePage { ...@@ -207,7 +207,7 @@ public class WelfarePage {
return driver.findElement(By.xpath(String.format("//label[@for='knowing_someone'][normalize-space()='%s']", radioButton))); return driver.findElement(By.xpath(String.format("//label[@for='knowing_someone'][normalize-space()='%s']", radioButton)));
} }
public String cnicNumber(){ public String cnicNumber() {
BigInteger maxLimit = new BigInteger("5000000000000"); BigInteger maxLimit = new BigInteger("5000000000000");
Random randNum = new Random(); Random randNum = new Random();
String len = String.valueOf(maxLimit.bitLength()); String len = String.valueOf(maxLimit.bitLength());
...@@ -215,14 +215,15 @@ public class WelfarePage { ...@@ -215,14 +215,15 @@ public class WelfarePage {
return res; return res;
} }
public String mobileNumber(){ public String mobileNumber() {
BigInteger maxLimit = new BigInteger("500000000"); BigInteger maxLimit = new BigInteger("500000000");
Random randNum = new Random(); Random randNum = new Random();
int len = maxLimit.bitLength(); int len = maxLimit.bitLength();
String phone = "03"+ new BigInteger(len, randNum); String phone = "03" + new BigInteger(len, randNum);
return phone; return phone;
} }
public String phoneNumber(){
public String phoneNumber() {
BigInteger maxLimit = new BigInteger("50000000000"); BigInteger maxLimit = new BigInteger("50000000000");
Random randNum = new Random(); Random randNum = new Random();
int len = maxLimit.bitLength(); int len = maxLimit.bitLength();
......
package com.example.pageobjects.usa;
import org.openqa.selenium.WebDriver;
public class PagesObject {
public WebPage webPage;
public WebDriver driver;
public PagesObject(WebDriver driver)
{
this.driver=driver;
}
public WebPage getWebPage(){
webPage=new WebPage(driver);
return webPage;
}
}
package com.example.pageobjects.usa;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
import java.util.Iterator;
import java.util.Set;
public class WebPage {
public WebDriver driver;
public WebPage(WebDriver driver) {
this.driver = driver;
}
public By donationCauseDropDownLocator = By.cssSelector("#dropdown1");
public By donationTypeDropDownLocator = By.cssSelector("#dropdown2");
public By donationAmountLocator = By.cssSelector("#dropdown3");
public void selectDonationCause(String type) {
driver.findElement(donationCauseDropDownLocator).click();
Select donationCause = new Select(driver.findElement(By.cssSelector("#dropdown1")));
donationCause.selectByVisibleText(type);
}
public void selectDonationType(String type) {
driver.findElement(donationTypeDropDownLocator).click();
Select donationCause = new Select(driver.findElement(By.cssSelector("#dropdown2")));
donationCause.selectByVisibleText(type);
}
public WebElement paymentTypes(String payment) {
return driver.findElement(By.xpath(String.format("//label[normalize-space()='%s']", payment)));
}
public void clickButton(String buttons) {
driver.findElement(By.xpath(String.format("//button[normalize-space()='%s']", buttons))).click();
}
public WebElement titleButton(String title) {
return driver.findElement(By.xpath(String.format("//p[normalize-space()='%s']", title)));
}
public WebElement payPalButton() {
return driver.findElement(By.xpath(" //button[@type='submit']"));
}
public WebElement title(String title) {
return driver.findElement(By.xpath(String.format("//h2[normalize-space()='%s']", title)));
}
public WebElement contactTitle(String title) {
return driver.findElement(By.xpath(String.format("//h3[normalize-space()='%s']", title)));
}
public String payPalTitle() {
return driver.findElement(By.xpath("//h1[normalize-space()='Log in to PayPal']")).getText();
}
public void selectPrograms(String programs) {
WebElement menuOption = driver.findElement(By.xpath("//p[normalize-space()='Programs']"));
Actions actions = new Actions(driver);
actions.moveToElement(menuOption).perform();
driver.findElement(By.xpath(String.format("//p[normalize-space()='%s']", programs))).click();
}
public String getCurrentUrl() {
String CurrentUrl = driver.getCurrentUrl();
System.out.println(CurrentUrl);
return CurrentUrl;
}
public void switchScreen() throws InterruptedException {
Thread.sleep(2000);
Set<String> s1 = driver.getWindowHandles();
Iterator<String> i1 = s1.iterator();
String parentWindow = i1.next();
String childWindow = i1.next();
driver.switchTo().window(childWindow);
}
}
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.AddToCartPage; import com.example.pageobjects.pakistan.AddToCartPage;
import com.example.Utils.TextContextSetup; import com.example.utils.TextContextSetup;
import io.cucumber.datatable.DataTable; import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.And; import io.cucumber.java.en.And;
import io.cucumber.java.en.Then; import io.cucumber.java.en.Then;
...@@ -41,11 +41,11 @@ public class AddToCartSteps { ...@@ -41,11 +41,11 @@ public class AddToCartSteps {
addToCartPage.donateNowButton(); addToCartPage.donateNowButton();
} }
@When("^I add 1000-Monthly donation to the cart$") @When("I add {string} donation to the cart")
public void iAddItemToCart() throws InterruptedException { public void iAddItemToCart(String addItem) throws InterruptedException {
AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage(); AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage();
Thread.sleep(2000); Thread.sleep(2000);
addToCartPage.addItem(); addToCartPage.addToCartItem(addItem);
} }
@When("^I add donation to the cart$") @When("^I add donation to the cart$")
...@@ -77,16 +77,6 @@ public class AddToCartSteps { ...@@ -77,16 +77,6 @@ public class AddToCartSteps {
addToCartPage.donationAddedToCart(donation).isDisplayed(); addToCartPage.donationAddedToCart(donation).isDisplayed();
} }
// @When("^I should see the following donation added to the cart$")
// public void iShouldSeeFollowingDonationAddedToCart(DataTable donations) throws Throwable {
// AddToCartPage addToCartPage=textContextSetup.pagesObject.getAddToCartPage();
// Thread.sleep(4000);
// List<Map<String,String>> data = donations.asMaps(String.class,String.class);
// for (Map<String, String> form : data)
// {
//
// }
// }
@When("^I close the messenger popUp$") @When("^I close the messenger popUp$")
public void messengerPopUp() throws InterruptedException { public void messengerPopUp() throws InterruptedException {
AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage(); AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage();
...@@ -141,7 +131,17 @@ public class AddToCartSteps { ...@@ -141,7 +131,17 @@ public class AddToCartSteps {
addToCartPage.amountInCart(itemData.get("amount")).isDisplayed(); addToCartPage.amountInCart(itemData.get("amount")).isDisplayed();
} }
} }
} }
@Then("I select {string} amount for the donation")
public void iShouldSelectAmountOfDonation(String amount) {
AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage();
addToCartPage.amountAddedForDonationInCart(amount);
}
@Then("I enter amount of {string} for donation")
public void iShouldEnterAmountOfDonation(String amount) {
AddToCartPage addToCartPage = textContextSetup.pagesObject.getAddToCartPage();
addToCartPage.enterAmountForDonationInCart().clear();
addToCartPage.enterAmountForDonationInCart().sendKeys(amount);
}
} }
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.BayanatPage; import com.example.pageobjects.pakistan.BayanatPage;
import com.example.Utils.TextContextSetup; import com.example.utils.TextContextSetup;
import io.cucumber.datatable.DataTable; import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
import org.testng.Assert; import org.testng.Assert;
...@@ -74,6 +74,6 @@ public class BayanatsPageSteps { ...@@ -74,6 +74,6 @@ public class BayanatsPageSteps {
BayanatPage bayanatPage = textContextSetup.pagesObject.getBayanatPage(); BayanatPage bayanatPage = textContextSetup.pagesObject.getBayanatPage();
String successMessage = bayanatPage.successAlertMessageLocator().getText(); String successMessage = bayanatPage.successAlertMessageLocator().getText();
System.out.println(successMessage); System.out.println(successMessage);
Assert.assertEquals(successMessage,"×\nAlert!\nThank you for applying as a volunteer"); Assert.assertEquals(successMessage, "×\nAlert!\nThank you for applying as a volunteer");
} }
} }
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.HomePage; import com.example.pageobjects.pakistan.HomePage;
import com.example.Utils.TextContextSetup; import com.example.utils.TextContextSetup;
import io.cucumber.datatable.DataTable; import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Then; import io.cucumber.java.en.Then;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
import org.openqa.selenium.Keys;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -60,8 +61,8 @@ public class HomePageSteps { ...@@ -60,8 +61,8 @@ public class HomePageSteps {
public void i_should_see_bayanat_list(DataTable bayanList) throws InterruptedException { public void i_should_see_bayanat_list(DataTable bayanList) throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage(); HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(7000); Thread.sleep(7000);
List<Map<String,String>> data = bayanList.asMaps(String.class,String.class); List<Map<String, String>> data = bayanList.asMaps(String.class, String.class);
for (Map<String, String> itemData : data){ for (Map<String, String> itemData : data) {
homePage.bayanListLocator(itemData.get("Bayanat")).isDisplayed(); homePage.bayanListLocator(itemData.get("Bayanat")).isDisplayed();
} }
} }
...@@ -70,7 +71,7 @@ public class HomePageSteps { ...@@ -70,7 +71,7 @@ public class HomePageSteps {
public void i_should_see_publication_list(DataTable bayanList) throws InterruptedException { public void i_should_see_publication_list(DataTable bayanList) throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage(); HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(7000); Thread.sleep(7000);
List<Map<String,String>> data = bayanList.asMaps(String.class,String.class); List<Map<String, String>> data = bayanList.asMaps(String.class, String.class);
for (Map<String, String> itemData : data) for (Map<String, String> itemData : data)
homePage.publicationListLocator(itemData.get("Publication")).isDisplayed(); homePage.publicationListLocator(itemData.get("Publication")).isDisplayed();
} }
...@@ -79,7 +80,7 @@ public class HomePageSteps { ...@@ -79,7 +80,7 @@ public class HomePageSteps {
public void i_should_see_education_project_list(DataTable bayanList) throws InterruptedException { public void i_should_see_education_project_list(DataTable bayanList) throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage(); HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(7000); Thread.sleep(7000);
List<Map<String,String>> data = bayanList.asMaps(String.class,String.class); List<Map<String, String>> data = bayanList.asMaps(String.class, String.class);
for (Map<String, String> itemData : data) for (Map<String, String> itemData : data)
homePage.educationProjectListLocator(itemData.get("Education")).isDisplayed(); homePage.educationProjectListLocator(itemData.get("Education")).isDisplayed();
} }
...@@ -88,11 +89,71 @@ public class HomePageSteps { ...@@ -88,11 +89,71 @@ public class HomePageSteps {
public void i_should_see_welfare_project_list(DataTable bayanList) throws InterruptedException { public void i_should_see_welfare_project_list(DataTable bayanList) throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage(); HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(7000); Thread.sleep(7000);
List<Map<String,String>> data = bayanList.asMaps(String.class,String.class); List<Map<String, String>> data = bayanList.asMaps(String.class, String.class);
for (Map<String, String> itemData : data) for (Map<String, String> itemData : data)
homePage.welfareProjectLocator(itemData.get("Welfare Project")).isDisplayed(); homePage.welfareProjectLocator(itemData.get("Welfare Project")).isDisplayed();
} }
@Then("I enter email {string} to subscribe 'BAITUSSALAMS NEWSLETTER' on home page")
public void i_enter_email_text(String email) {
HomePage homePage = textContextSetup.pagesObject.getHomePage();
homePage.emailFieldForSubscription().sendKeys(email);
homePage.emailFieldForSubscription().sendKeys(Keys.ENTER);
}
@Then("^I should see the success message$")
public void i_Should_See_Success_Message() throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(3000);
homePage.successMessage().isDisplayed();
String successMessage = homePage.successMessage().getText();
System.out.println("Success alert " + successMessage);
}
@Then("I click on {string} to follow other social media account")
public void i_Click_Other_Social_Media_Account(String button) throws InterruptedException {
HomePage homePage = textContextSetup.pagesObject.getHomePage();
Thread.sleep(3000);
homePage.socialMediaButton(button).click();
Thread.sleep(7000);
}
@When("I fill contact form with following data :")
public void iFillFromOfOccupationInformation(DataTable formData) {
HomePage homePage = textContextSetup.pagesObject.getHomePage();
List<Map<String, String>> data = formData.asMaps(String.class, String.class);
for (Map<String, String> itemData : data) {
if (itemData.containsKey("name")) {
homePage.contactNameField().clear();
homePage.contactNameField().sendKeys(itemData.get("name"));
}
if (itemData.containsKey("subject")) {
homePage.contactSubjectField().clear();
homePage.contactSubjectField().sendKeys(itemData.get("subject"));
}
if (itemData.containsKey("phone")) {
homePage.contactPhoneField().clear();
homePage.contactPhoneField().sendKeys(itemData.get("phone"));
}
if (itemData.containsKey("message")) {
homePage.messageField().clear();
homePage.messageField().sendKeys(itemData.get("message"));
}
if (itemData.containsKey("email")) {
homePage.contactEmailField().clear();
String[] arrSplit = itemData.get("email").split("@");
String emailAddress = "";
while (emailAddress.length() < 5) {
emailAddress += arrSplit[0];
emailAddress += Integer.valueOf((int) (Math.random() * 99)).toString();
emailAddress += "@" + arrSplit[1];
homePage.contactEmailField().sendKeys(emailAddress);
}
}
}
}
} }
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.AddToCartPage; import com.example.utils.TextContextSetup;
import com.example.Utils.TextContextSetup;
import io.cucumber.java.After; import io.cucumber.java.After;
import io.cucumber.java.AfterStep; import io.cucumber.java.AfterStep;
import io.cucumber.java.BeforeStep;
import io.cucumber.java.Scenario; import io.cucumber.java.Scenario;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType; import org.openqa.selenium.OutputType;
...@@ -16,24 +14,25 @@ import java.io.IOException; ...@@ -16,24 +14,25 @@ import java.io.IOException;
public class Hooks { public class Hooks {
TextContextSetup textContextSetup; TextContextSetup textContextSetup;
public Hooks(TextContextSetup textContextSetup){
this.textContextSetup=textContextSetup;
} public Hooks(TextContextSetup textContextSetup) {
this.textContextSetup = textContextSetup;
}
@After @After
public void closingDriver() throws IOException { public void closingDriver() throws IOException {
textContextSetup.baseClass.WebDriverManager().quit(); textContextSetup.driverManager.WebDriverManager().quit();
} }
@AfterStep @AfterStep
public void addScreenShot(Scenario scenario) throws IOException { public void addScreenShot(Scenario scenario) throws IOException {
WebDriver driver= textContextSetup.baseClass.WebDriverManager(); WebDriver driver = textContextSetup.driverManager.WebDriverManager();
if(scenario.isFailed()) if (scenario.isFailed()) {
{ File sourcePath = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
File sourcePath=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); byte[] fileContent = FileUtils.readFileToByteArray(sourcePath);
byte[] fileContent= FileUtils.readFileToByteArray(sourcePath); scenario.attach(fileContent, "image/png", "Error image");
scenario.attach(fileContent,"image/png","Error image"); }
}
} }
} }
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.PublicationPage; import com.example.pageobjects.pakistan.PublicationPage;
import com.example.Utils.TextContextSetup; import com.example.utils.TextContextSetup;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
public class PublicationPageSteps { public class PublicationPageSteps {
...@@ -14,26 +14,25 @@ public class PublicationPageSteps { ...@@ -14,26 +14,25 @@ public class PublicationPageSteps {
@When("I select header {string} on publication page") @When("I select header {string} on publication page")
public void iShouldSelectItemFromDropDownHeaderTitle(String header) throws InterruptedException { public void iShouldSelectItemFromDropDownHeaderTitle(String header) throws InterruptedException {
PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage(); PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage();
Thread.sleep(300); Thread.sleep(300);
publicationPage.pageHeader(header).click(); publicationPage.pageHeader(header).click();
} }
@When("I select {string} Publication Type on Subscribe for our publications on publication page") @When("I select {string} Publication Type on Subscribe for our publications on publication page")
public void iShouldSelectPublicationType(String publicationType) throws InterruptedException { public void iShouldSelectPublicationType(String publicationType) throws InterruptedException {
PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage(); PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage();
Thread.sleep(300); Thread.sleep(300);
publicationPage.publicationType(publicationType); publicationPage.publicationType(publicationType);
} }
@When("I enter email {string} on Subscribe for our publication modal") @When("I enter email {string} on Subscribe for our publication modal")
public void iEnterEmailOnSubscribeForPublicationModal(String email) throws InterruptedException { public void iEnterEmailOnSubscribeForPublicationModal(String email) {
PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage(); PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage();
Thread.sleep(300);
publicationPage.email().sendKeys(email); publicationPage.email().sendKeys(email);
} }
@When("I enter {string} in Search field in order to search on publication page") @When("I enter {string} in Search field in order to search on publication page")
public void iSearchFromSearchBoxForPublicationPage(String searchItem){ public void iSearchFromSearchBoxForPublicationPage(String searchItem) {
PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage(); PublicationPage publicationPage = textContextSetup.pagesObject.getPublicationPage();
publicationPage.searchFieldLocator().sendKeys(searchItem); publicationPage.searchFieldLocator().sendKeys(searchItem);
publicationPage.searchButton().click(); publicationPage.searchButton().click();
......
package com.example.StepDefinations; package com.example.stepdefinations.pakistan;
import com.example.PageObjects.PublicationPage; import com.example.pageobjects.pakistan.PublicationPage;
import com.example.PageObjects.WelfarePage; import com.example.pageobjects.pakistan.WelfarePage;
import com.example.Utils.TextContextSetup; import com.example.utils.TextContextSetup;
import io.cucumber.datatable.DataTable; import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Given; import io.cucumber.java.en.Given;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.Select;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random;
public class WelfarePageSteps { public class WelfarePageSteps {
...@@ -118,24 +118,25 @@ public class WelfarePageSteps { ...@@ -118,24 +118,25 @@ public class WelfarePageSteps {
} }
} }
if (itemData.containsKey("phoneNumber")) { if (itemData.containsKey("phoneNumber")) {
if(itemData.get("phoneNumber").equalsIgnoreCase("random")){ if (itemData.get("phoneNumber").equalsIgnoreCase("random")) {
welfarePage.phoneFieldLocator().clear(); welfarePage.phoneFieldLocator().clear();
String phoneNumber= welfarePage.phoneNumber(); String phoneNumber = welfarePage.phoneNumber();
welfarePage.phoneFieldLocator().sendKeys(phoneNumber); welfarePage.phoneFieldLocator().sendKeys(phoneNumber);
}else { } else {
welfarePage.phoneFieldLocator().clear(); welfarePage.phoneFieldLocator().clear();
welfarePage.phoneFieldLocator().sendKeys(itemData.get("phoneNumber")); welfarePage.phoneFieldLocator().sendKeys(itemData.get("phoneNumber"));
}} }
}
if (itemData.containsKey("CNIC")) { if (itemData.containsKey("CNIC")) {
if(itemData.get("CNIC").equalsIgnoreCase("random")){ if (itemData.get("CNIC").equalsIgnoreCase("random")) {
welfarePage.cnicFieldLocator().clear(); welfarePage.cnicFieldLocator().clear();
String cnicNumber=welfarePage.cnicNumber(); String cnicNumber = welfarePage.cnicNumber();
welfarePage.cnicFieldLocator().sendKeys(cnicNumber); welfarePage.cnicFieldLocator().sendKeys(cnicNumber);
} else {
welfarePage.cnicFieldLocator().clear();
welfarePage.cnicFieldLocator().sendKeys(itemData.get("CNIC"));
} }
else{ }
welfarePage.cnicFieldLocator().clear();
welfarePage.cnicFieldLocator().sendKeys(itemData.get("CNIC"));
}}
if (itemData.containsKey("address")) { if (itemData.containsKey("address")) {
welfarePage.addressFieldLocator().clear(); welfarePage.addressFieldLocator().clear();
welfarePage.addressFieldLocator().sendKeys(itemData.get("address")); welfarePage.addressFieldLocator().sendKeys(itemData.get("address"));
...@@ -240,15 +241,16 @@ public class WelfarePageSteps { ...@@ -240,15 +241,16 @@ public class WelfarePageSteps {
List<Map<String, String>> data = formData.asMaps(String.class, String.class); List<Map<String, String>> data = formData.asMaps(String.class, String.class);
for (Map<String, String> itemData : data) { for (Map<String, String> itemData : data) {
if (itemData.containsKey("workExperience")) if (itemData.containsKey("workExperience")) {
{ if ((itemData.get("workExperience")).equalsIgnoreCase("Yes")) {
if ((itemData.get("workExperience")).equalsIgnoreCase("Yes")) { welfarePage.volunteerExperienceRadioButton(itemData.get("workExperience")).click();
welfarePage.volunteerExperienceRadioButton(itemData.get("workExperience")).click(); }
}} }
if (itemData.containsKey("workExperienceDetail")){ if (itemData.containsKey("workExperienceDetail")) {
if (itemData.get("workExperience").equalsIgnoreCase("Yes") ){ if (itemData.get("workExperience").equalsIgnoreCase("Yes")) {
welfarePage.volunteerExperienceDescription().sendKeys(itemData.get("workExperienceDetail")); welfarePage.volunteerExperienceDescription().sendKeys(itemData.get("workExperienceDetail"));
}} }
}
if (itemData.containsKey("startWorkingDate")) { if (itemData.containsKey("startWorkingDate")) {
welfarePage.workStartDate().clear(); welfarePage.workStartDate().clear();
welfarePage.workStartDate().sendKeys(itemData.get("startWorkingDate")); welfarePage.workStartDate().sendKeys(itemData.get("startWorkingDate"));
...@@ -268,8 +270,8 @@ public class WelfarePageSteps { ...@@ -268,8 +270,8 @@ public class WelfarePageSteps {
welfarePage.monthsAvailability(itemData.get("monthlyAvailability")).click(); welfarePage.monthsAvailability(itemData.get("monthlyAvailability")).click();
} }
if (itemData.containsKey("dayAvailability")) { if (itemData.containsKey("dayAvailability")) {
String arr[]= itemData.get("dayAvailability").split(","); String arr[] = itemData.get("dayAvailability").split(",");
welfarePage.daysAvailability(arr[0],arr[1]).click(); welfarePage.daysAvailability(arr[0], arr[1]).click();
} }
if (itemData.containsKey("reasonForWorking")) { if (itemData.containsKey("reasonForWorking")) {
welfarePage.reasonToWork().sendKeys(itemData.get("reasonForWorking")); welfarePage.reasonToWork().sendKeys(itemData.get("reasonForWorking"));
......
package com.example.stepdefinations.usa;
import com.example.utils.TextContextSetupUSA;
import io.cucumber.java.After;
import io.cucumber.java.AfterStep;
import io.cucumber.java.Scenario;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import java.io.File;
import java.io.IOException;
public class HooksUsa {
TextContextSetupUSA textContextSetup;
public HooksUsa(TextContextSetupUSA textContextSetup) {
this.textContextSetup = textContextSetup;
}
@After
public void closingDriver() throws IOException {
textContextSetup.driverManager.WebDriverManagerUsa().quit();
}
@AfterStep
public void addScreenShot(Scenario scenario) throws IOException {
WebDriver driver = textContextSetup.driverManager.WebDriverManager();
if (scenario.isFailed()) {
File sourcePath = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
byte[] fileContent = FileUtils.readFileToByteArray(sourcePath);
scenario.attach(fileContent, "image/png", "Error image");
}
}
}
package com.example.stepdefinations.usa;
import com.example.pageobjects.usa.WebPage;
import com.example.utils.TextContextSetupUSA;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.testng.Assert;
public class WebPageSteps {
TextContextSetupUSA textContextSetup;
public WebPageSteps(TextContextSetupUSA textContextSetup) {
this.textContextSetup = textContextSetup;
}
@When("I select donation {string} cause in 'Donation now modal' on Home page")
public void iSelectDonationCause(String type) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.selectDonationCause(type);
}
@When("I select donation {string} type in 'Donation now modal' on Home page")
public void iSelectDonationType(String type) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.selectDonationType(type);
}
@When("I select {string} payment type")
public void iSelectPayment(String paymentType) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.paymentTypes(paymentType).click();
}
@When("^I press paypal button$")
public void iPressButton() throws InterruptedException {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
Thread.sleep(1000);
webPage.payPalButton().click();
Thread.sleep(7000);
}
@When("I Enter Donation {string} amount")
public void iEnterDonationAmount(String amount) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.driver.findElement(webPage.donationAmountLocator).sendKeys(amount);
}
@When("I press {string} title button on home page")
public void iPressTitleButton(String button) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.titleButton(button).click();
}
@Then("I should see tile button is redirected to {string}")
public void iShouldSee(String title) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.title(title).isDisplayed();
}
@Then("I should see tile button is redirected to contacts {string}")
public void iShouldSeeContactsInformation(String title) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.contactTitle(title).isDisplayed();
}
@When("I hover on program and select the {string} program")
public void iSelectPrograms(String title) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.selectPrograms(title);
}
@When("I click on {string} button")
public void iClickOnButton(String button) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.clickButton(button);
}
@When("User redirected to correct website {string}")
public void iRedirectedToWebsite(String websiteUrl) {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
String currentUrl = webPage.getCurrentUrl();
Assert.assertEquals(websiteUrl, currentUrl);
}
@When("User landed on paypal {string} page")
public void iRedirectedToPaypal(String paypalTitle) throws InterruptedException {
WebPage webPage = textContextSetup.pagesObject.getWebPage();
webPage.switchScreen();
String pageTitle = webPage.payPalTitle();
System.out.println(pageTitle);
Assert.assertEquals(paypalTitle, pageTitle);
}
}
package com.example.utils;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class DriverManager {
public WebDriver driver;
public WebDriver WebDriverManager() throws IOException {
FileInputStream fis = new FileInputStream(System.getProperty("user.dir") + "//src//test//resources//global.properties");
Properties prop = new Properties();
prop.load(fis);
String urlPk = prop.getProperty("UrlPk");
String browser_properties = prop.getProperty("browser");
String browser_maven = System.getProperty("browser");
String browser = browser_maven != null ? browser_maven : browser_properties;
if (driver == null) {
//Todo: For chrome browser any other browser can add their
if (browser.equalsIgnoreCase("chrome")) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/chromedriver");
DesiredCapabilities caps = new DesiredCapabilities();
LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
driver = new ChromeDriver(caps);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
//Todo: Fire fox work will be included
// if(browser.equalsIgnoreCase("firefox"))
// {
// System.setProperty("webdriver.gecko.driver", "src/test/resources/geckodriver");
// driver= new FirefoxDriver();
// driver.manage().window().maximize();
// }
driver.get(urlPk);
}
return driver;
}
public WebDriver WebDriverManagerUsa() throws IOException {
FileInputStream fis = new FileInputStream(System.getProperty("user.dir") + "//src//test//resources//global.properties");
Properties prop = new Properties();
prop.load(fis);
String urlPk = prop.getProperty("UrlUsa");
String browser_properties = prop.getProperty("browser");
String browser_maven = System.getProperty("browser");
String browser = browser_maven != null ? browser_maven : browser_properties;
if (driver == null) {
if (browser.equalsIgnoreCase("chrome")) { //For chrome browser any other browser can add their
System.setProperty("webdriver.chrome.driver", "src/test/resources/chromedriver");
DesiredCapabilities caps = new DesiredCapabilities();
LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
driver = new ChromeDriver(caps);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
//Todo: Fire fox work will be included
// if(browser.equalsIgnoreCase("firefox"))
// {
// System.setProperty("webdriver.gecko.driver", "src/test/resources/geckodriver");
// driver= new FirefoxDriver();
// driver.manage().window().maximize();
// }
driver.get(urlPk);
}
return driver;
}
}
package com.example.Utils; package com.example.utils;
import com.example.PageObjects.PagesObject; import com.example.pageobjects.pakistan.PagesObject;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import java.io.IOException; import java.io.IOException;
...@@ -8,9 +8,12 @@ import java.io.IOException; ...@@ -8,9 +8,12 @@ import java.io.IOException;
public class TextContextSetup { public class TextContextSetup {
public WebDriver driver; public WebDriver driver;
public PagesObject pagesObject; public PagesObject pagesObject;
public BaseClass baseClass; public DriverManager driverManager;
public TextContextSetup() throws IOException { public TextContextSetup() throws IOException {
baseClass=new BaseClass(); driverManager = new DriverManager();
pagesObject=new PagesObject(baseClass.WebDriverManager()); pagesObject = new PagesObject(driverManager.WebDriverManager());
} }
} }
package com.example.utils;
import com.example.pageobjects.pakistan.PagesObject;
import org.openqa.selenium.WebDriver;
import java.io.IOException;
public class TextContextSetupUSA {
public WebDriver driver;
public PagesObject pagesObject;
public DriverManager driverManager;
public TextContextSetupUSA() throws IOException {
driverManager = new DriverManager();
pagesObject = new PagesObject(driverManager.WebDriverManagerUsa());
}
}
...@@ -8,7 +8,7 @@ Feature: Add_To_Cart ...@@ -8,7 +8,7 @@ Feature: Add_To_Cart
@web @web
Scenario: To verify 1000-Monthly donation for One-time added to the cart Scenario: To verify 1000-Monthly donation for One-time added to the cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "One Time" payment And I select "One Time" payment
And I press "Add Donation" And I press "Add Donation"
Then I should see "1000 - Monthly" is added to the cart Then I should see "1000 - Monthly" is added to the cart
...@@ -16,7 +16,7 @@ Feature: Add_To_Cart ...@@ -16,7 +16,7 @@ Feature: Add_To_Cart
@web @web
Scenario: To verify 1000-Monthly donation on Recurring Weekly basis is added to the cart Scenario: To verify 1000-Monthly donation on Recurring Weekly basis is added to the cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Weekly" payment And I select "Weekly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -24,8 +24,8 @@ Feature: Add_To_Cart ...@@ -24,8 +24,8 @@ Feature: Add_To_Cart
@web @web
Scenario: To verify 1000-Monthly donation on Recurring Monthly basis is added to the cart Scenario: To verify 1000-Monthly donation on Recurring Monthly basis is added to the cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -34,7 +34,7 @@ Feature: Add_To_Cart ...@@ -34,7 +34,7 @@ Feature: Add_To_Cart
@web @web
Scenario: To verify 1000-Monthly donation on Recurring Yearly basis is added to the cart Scenario: To verify 1000-Monthly donation on Recurring Yearly basis is added to the cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -42,12 +42,12 @@ Feature: Add_To_Cart ...@@ -42,12 +42,12 @@ Feature: Add_To_Cart
@web @web
Scenario: To verify multiple donation of 1000-Monthly monthly added to cart Scenario: To verify multiple donation of 1000-Monthly monthly added to cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -58,17 +58,17 @@ Feature: Add_To_Cart ...@@ -58,17 +58,17 @@ Feature: Add_To_Cart
@web @web
Scenario:Verify user shouldn't see removed listed donation to the cart when add new donation to cart Scenario:Verify user shouldn't see removed listed donation to the cart when add new donation to cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -79,14 +79,15 @@ Feature: Add_To_Cart ...@@ -79,14 +79,15 @@ Feature: Add_To_Cart
| 1000 - Monthly | | 1000 - Monthly |
When I remove "1" Donation to the cart When I remove "1" Donation to the cart
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
Then I should see You are donating to "3" cause Then I should see You are donating to "3" cause
# <------ After remove of any donation Use see removed listed donation in the cart-------->
Scenario:To check checkout button is clickable and user is redirected to checkout page Scenario:To check checkout button is clickable and user is redirected to checkout page
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -95,17 +96,17 @@ Feature: Add_To_Cart ...@@ -95,17 +96,17 @@ Feature: Add_To_Cart
@web @web
Scenario:User Should be able to see correct number of donation after removing donation to cart list Scenario:User Should be able to see correct number of donation after removing donation to cart list
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -114,57 +115,36 @@ Feature: Add_To_Cart ...@@ -114,57 +115,36 @@ Feature: Add_To_Cart
@web @web
Scenario:User should see correct amount of added donation in the cart Scenario:User should see correct amount of added donation in the cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
Then I should see total amount Rs"3000" on add to cart module Then I should see total amount Rs"3000" on add to cart module
@web
Scenario:User Should be able to see correct number of donation after removing donation to cart list
When I add 1000-Monthly donation to the cart
And I select "Recurring" payment
And I select "Monthly" payment
And I press "Add Donation"
When I press "Add Another"
And I add 1000-Monthly donation to the cart
And I select "Recurring" payment
And I select "Yearly" payment
And I press "Add Donation"
When I press "Add Another"
And I add 1000-Monthly donation to the cart
And I select "Recurring" payment
And I select "Monthly" payment
And I press "Add Donation"
Then I should see the following donation detail added to the cart
| title | amount |
| 1000 - Monthly | 1000 |
| 1000 - Monthly | 1000 |
| 1000 - Monthly | 1000 |
@web @web
Scenario:User should not be able to remove all the donation of 1000-Monthly Recurring donation to cart when remove the first donation to cart list Scenario:User should be redirected to checkout page after adding donation to cart
When I add 1000-Monthly donation to the cart When I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add donation to the cart And I add "Baitussalam Nusrat Roti Pack - Syria - Sadqa" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Yearly" payment And I select "Yearly" payment
And I press "Add Donation" And I press "Add Donation"
When I press "Add Another" When I press "Add Another"
And I add 1000-Monthly donation to the cart And I add "1000 - Monthly" donation to the cart
And I select "Recurring" payment And I select "Recurring" payment
And I select "Monthly" payment And I select "Monthly" payment
And I press "Add Donation" And I press "Add Donation"
...@@ -176,3 +156,17 @@ Feature: Add_To_Cart ...@@ -176,3 +156,17 @@ Feature: Add_To_Cart
When I press "Checkout" When I press "Checkout"
Then User should be redirected to "Checkout" page Then User should be redirected to "Checkout" page
@web
Scenario:User should be redirected to checkout page after adding donation to cart in which user able to enter amount of donation
When I add "Sadaqah - Water" donation to the cart
And I select "Recurring" payment
And I select "Monthly" payment
And I select "Other Amount" amount for the donation
And I enter amount of "100" for donation
And I press "Add Donation"
Then I should see the following donation detail added to the cart
| title | amount |
| Sadaqah - Water | Rs. 100 |
When I press "Checkout"
Then User should be redirected to "Checkout" page
\ No newline at end of file
...@@ -6,7 +6,7 @@ Feature: Education_Page ...@@ -6,7 +6,7 @@ Feature: Education_Page
@web @web
Scenario Outline: User should be redirected to correct pages when Selecting Projects from drop down Scenario Outline: User should be redirected to correct pages when Selecting Projects from drop down On Education Page
When I select a "education" feature on home page When I select a "education" feature on home page
And I should hover on "Projects" welfare header title to select "<headerItems>" item from drop down on welfare page And I should hover on "Projects" welfare header title to select "<headerItems>" item from drop down on welfare page
Then User should be redirected to "<pages>" page Then User should be redirected to "<pages>" page
...@@ -17,7 +17,7 @@ Feature: Education_Page ...@@ -17,7 +17,7 @@ Feature: Education_Page
@web @web
Scenario Outline: User should be redirected to correct pages when Selecting Events from drop down Scenario Outline: User should be redirected to correct pages when Selecting Events from drop down On Education Page
When I select a "education" feature on home page When I select a "education" feature on home page
And I should hover on "Events" welfare header title to select "<headerItems>" item from drop down on welfare page And I should hover on "Events" welfare header title to select "<headerItems>" item from drop down on welfare page
Then User should be redirected to "<pages>" page Then User should be redirected to "<pages>" page
...@@ -28,7 +28,7 @@ Feature: Education_Page ...@@ -28,7 +28,7 @@ Feature: Education_Page
@web @web
Scenario Outline: User should be redirected to correct pages when Selecting News from drop down Scenario Outline: User should be redirected to correct pages when Selecting News from drop down On Education Page
When I select a "education" feature on home page When I select a "education" feature on home page
And I should hover on "News" welfare header title to select "<headerItems>" item from drop down on welfare page And I should hover on "News" welfare header title to select "<headerItems>" item from drop down on welfare page
Then User should be redirected to "<pages>" page Then User should be redirected to "<pages>" page
...@@ -41,7 +41,7 @@ Feature: Education_Page ...@@ -41,7 +41,7 @@ Feature: Education_Page
| Abdülhamit School | Abdülhamit School | | Abdülhamit School | Abdülhamit School |
@web @web
Scenario Outline: User should be redirected to correct pages when Selecting Media from drop down Scenario Outline: User should be redirected to correct pages when Selecting Media from drop down On Education Page
When I select a "education" feature on home page When I select a "education" feature on home page
And I should hover on "Media" welfare header title to select "<headerItems>" item from drop down on welfare page And I should hover on "Media" welfare header title to select "<headerItems>" item from drop down on welfare page
Then User should be redirected to "<pages>" page Then User should be redirected to "<pages>" page
...@@ -50,3 +50,21 @@ Feature: Education_Page ...@@ -50,3 +50,21 @@ Feature: Education_Page
| headerItems | pages | | headerItems | pages |
| Images | Gallery | | Images | Gallery |
| Videos | Gallery | | Videos | Gallery |
@web
Scenario: User should be redirected to correct pages when Selecting About Us On Education Page
When I select a "education" feature on home page
When I click on "About us" button on welfare page
Then User should be redirected to "About us" page
@web
Scenario: User should be redirected to correct pages when Selecting Contact Us On Education Page
When I select a "education" feature on home page
When I click on "Contact" button on welfare page
Then User should be redirected to "Contact" page
@web
Scenario: User should be redirected to correct pages when Selecting Contribute On Education Page
When I select a "education" feature on home page
When I click on "Contribute" button on welfare page
Then User should be redirected to "Ways to Donate" page
...@@ -6,10 +6,14 @@ Feature: HomePage ...@@ -6,10 +6,14 @@ Feature: HomePage
@web @web
Scenario: User should be redirected to About Us ,TimeLine pages Scenario: User should be redirected to About Us
When I Click on About Us button on Home page When I Click on About Us button on Home page
And Close the popup And Close the popup
Then User should be redirected to "About us" page Then User should be redirected to "About us" page
@web
Scenario: User should be redirected to TimeLine pages
When I Click On Our Timeline Button On home page When I Click On Our Timeline Button On home page
And Close the popup And Close the popup
Then User should be redirected to "Timeline" page Then User should be redirected to "Timeline" page
...@@ -19,7 +23,11 @@ Feature: HomePage ...@@ -19,7 +23,11 @@ Feature: HomePage
Scenario: User should be redirected to Contact page Scenario: User should be redirected to Contact page
When I Click On Our contact Button On home page When I Click On Our contact Button On home page
Then User should be redirected to "Contact" page Then User should be redirected to "Contact" page
When I fill contact form with following data :
| name | email | subject | phone | message |
| testing | abc@123.com | software engineer | 031232131231231 | testing a web app |
And I press "Send your message"
# <-------- Bug after click on Send your message button -------->
@web @web
Scenario: User should be redirected to bayanat page Scenario: User should be redirected to bayanat page
...@@ -64,5 +72,9 @@ Feature: HomePage ...@@ -64,5 +72,9 @@ Feature: HomePage
| RELIEF FOR BEIRUT | | RELIEF FOR BEIRUT |
@web
Scenario: User should be able to subscribe 'BAITUSSALAM NEWSLETTER'
When I enter email "abc@123.com" to subscribe 'BAITUSSALAMS NEWSLETTER' on home page
Then I should see the success message
...@@ -6,7 +6,7 @@ Feature: Publication Feature ...@@ -6,7 +6,7 @@ Feature: Publication Feature
@web @web
Scenario Outline: User should be able redirecting to correct pages by selecting header from publication page Scenario Outline: User should be able redirecting to correct pages by selecting header from publication page
When I select a "publication" feature on home page When I select a "publication" feature on home page
And I select header "<headerItems>" on publication page And I select header "<headerItems>" on publication page
Then User should be redirected to "<pages>" page Then User should be redirected to "<pages>" page
...@@ -22,7 +22,6 @@ Feature: Publication Feature ...@@ -22,7 +22,6 @@ Feature: Publication Feature
| Booklets by Maulana Adbul Sattar | Booklets by Maulana Adbul Sattar | | Booklets by Maulana Adbul Sattar | Booklets by Maulana Adbul Sattar |
@web @web
Scenario: User should be able to subscribe for publication Scenario: User should be able to subscribe for publication
When I select a "publication" feature on home page When I select a "publication" feature on home page
...@@ -30,13 +29,12 @@ Feature: Publication Feature ...@@ -30,13 +29,12 @@ Feature: Publication Feature
And I select "Bulletin" Publication Type on Subscribe for our publications on publication page And I select "Bulletin" Publication Type on Subscribe for our publications on publication page
And I enter email "abc@abc.com" on Subscribe for our publication modal And I enter email "abc@abc.com" on Subscribe for our publication modal
And I press "Subscribe Now" And I press "Subscribe Now"
# <-------- Bug "Subscribe now button" is not working ------> # <-------- Bug "Subscribe now button" is not working after click its start loading not redirect to any page ------>
@web @web
Scenario: User should be able to search for publication Scenario: User should be able to search for publication
When I select a "publication" feature on home page When I select a "publication" feature on home page
And I select header "Subscribe Now" on publication page
And I enter "Intellect Magazine" in Search field in order to search on publication page And I enter "Intellect Magazine" in Search field in order to search on publication page
Then User should be redirected to "Results for Intellect Magazine" page Then User should be redirected to "Results for Intellect Magazine" page
# <------ Bug Always directed to search page even if page is not present(return empty page) --------> # <------ Bug Always directed to search page even if page is not present(return empty page) -------->
...@@ -101,12 +101,12 @@ Feature: Welfare Feature ...@@ -101,12 +101,12 @@ Feature: Welfare Feature
Then User should be redirected to "Ways to Donate" page Then User should be redirected to "Ways to Donate" page
@web @web
Scenario: User should be able to become a volunteer Scenario: User should be able to become a volunteer on welfare Page
When I select a "welfare" feature on home page When I select a "welfare" feature on home page
When I click on "Join Us" button on welfare page When I click on "Join Us" button on welfare page
And I fill Volunteer information in the Become a Volunteer form with the following data on welfare Page: And I fill Volunteer information in the Become a Volunteer form with the following data on welfare Page:
| fullName | DateOfBirth | email | phoneNumber | address | city | country | CNIC | mobileNumber | postalCode | | fullName | DateOfBirth | email | phoneNumber | address | city | country | CNIC | mobileNumber | postalCode |
| Muhammad rahim | 2000-10-03 | test@123gmail.com | random | karachi | xyz street | Pakistan | random | random | 12313 | | Muhammad rahim | 2000-10-03 | test@123gmail.com | random | karachi | xyz street | Pakistan | random | random | 12313 |
And I fill alternate contact information in the Become a Volunteer form with the following data on welfare Page: And I fill alternate contact information in the Become a Volunteer form with the following data on welfare Page:
| alternateFullName | relation | alternatePhoneNumber | alternateAddress | alternateCity | alternateCountry | alternateMobileNumber | alternatePostalCode | education | | alternateFullName | relation | alternatePhoneNumber | alternateAddress | alternateCity | alternateCountry | alternateMobileNumber | alternatePostalCode | education |
| Muhammad rahim | Friend | 12323123 | abc street | karachi | Pakistan | 0312313141414 | 42233 | Graduation | | Muhammad rahim | Friend | 12323123 | abc street | karachi | Pakistan | 0312313141414 | 42233 | Graduation |
......
Feature: Add donation
@web
Scenario Outline: User should be able to make a donation
When I select "One Time" payment type
And I select donation "<cause>" cause in 'Donation now modal' on Home page
And I select donation "<type>" type in 'Donation now modal' on Home page
And I Enter Donation "200" amount
And I press paypal button
Then User landed on paypal "Log in to PayPal" page
Examples:
| cause | type |
| General | SADAQAH |
| General | ZAKAT |
| General | ATYAAT |
| General | AQEEQA |
| General | WAQF |
| General | BRANCH_ONLINE |
| Monthly Scholarship | ZAKAT |
| Construction of Schools | ATYAAT |
| Monthly USD$50 Food Basket | WAQF |
| Monthly Scholarship | SADAQAH |
| Monthly Kafalat Program | WAQF |
| Construction of Schools | ZAKAT |
| Construction of Saiban | WAQF |
@web
Scenario: User should be correctly redirected by clicking on header buttons
When I press "About Us" title button on home page
Then I should see tile button is redirected to "About Baitussalam USA"
When I press "Programs" title button on home page
Then I should see tile button is redirected to "Projects & Programs"
When I press "Programs" title button on home page
Then I should see tile button is redirected to contacts "Quick Connect"
@web
Scenario: User should be see to selected programs
When I hover on program and select the "Monthly Food Basket Distribution Program" program
Then I should see tile button is redirected to "Monthly Food Basket Distribution Program"
When I hover on program and select the "Eid-ul-Adha Qurbani (Waqf) Program" program
Then I should see tile button is redirected to "Eid-ul-Adha Qurbani (Waqf) Program"
@web
Scenario: User should be redirected to Baitussalam Pakistan by clicking on Our Partner button
When I click on "Our Partner" button
Then User redirected to correct website "https://www.baitussalam.org/"
browser=Chrome
UrlPk=https://dev.baitussalam.org/
UrlUsa=https://dev.baitussalamusa.org/
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<suite name="Test Suite" verbose="1"> <suite name="Test Suite" verbose="1">
<test name="Regression Tests"> <test name="Regression Tests">
<classes> <classes>
<class name="com.example.TestRunner"> <class name="com.example.TestRunnerPk">
</class> </class>
</classes> </classes>
</test> </test>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment