Page Object Framework using cucumber jvm (java) and Selenium java.
http://morty.fam***-*****.com:8585
#Maven https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html The cucumber setup for ITEM PAGES - uses maven rules such as: clean test site -Dcucumber.options="--tags @setup --tags @items" s and brand page would be the same, except @brands. the SETUP is what generates our spreadsheet and no subsequential jobs can run unless the SETUP runs as well.
#Execution All the page objects work as static elements. We have an 'opinionated' execution. In other words, we know exactly what type of page we are every moment of the execution.
#Cucumber https://blog.engineyard.com/2009/cucumber-introduction Our features are dynamically generated from a group of templates after scrapping some data from the web , particularly, the URL to which we are going to perform the validations. The links contained in the bottom of this README are the templates, which are the "cucumber test cases"
Hence the setup feature which performs the data extraction and creates the features from the templates.
#Running it locally Pre-condition:
- Brands --Setup
- Run scripts\jenkins\pre_steps_setup_htmlunit.bat
- Run mvn clean test site -Dcucumber.options="--tags @setup --tags @brands"
- Run scripts\jenkins\post_steps_setup_brands.bat --Seo1
- Run scripts\jenkins\pre_steps_brands_htmlunit.bat
- Run mvn clean test site -Dcucumber.options="--tags @brands --tags @seo1" --Seo2
- Run scripts\jenkins\pre_steps_brands_htmlunit.bat
- Run mvn clean test site -Dcucumber.options="--tags @brands --tags @seo2" --validation
- Run scripts\jenkins\pre_steps_brands_htmlunit.bat
- Run mvn clean test site -Dcucumber.options="--tags @brands --tags @validation" --validation
- Run scripts\jenkins\pre_steps_brands_htmlunit.bat
- Run mvn clean test site -Dcucumber.options="--tags @brands --tags @actionvalidation" ...............so on.
You then run the program by running "jenkins-localchrome.bat" in the project home directory. Or, with intelliJ with the proper Maven rules configured.
You will want to verify:
private static WebDriver createLocalChromeDriver() { System.setProperty( "webdriver.chrome.driver", "C:\chromedriver.exe"); return new ChromeDriver(); }
:exists in navigation\WebDriverFactory.java, and the /properties/Testconfig.properties is using LOCAL_CHROME as the SELENIUM_DRIVER #What do these tests in jenkins do?
Bash scripts (similar to the .bat files) contained in scripts\linux need to be added to the Jenkins job in prebuild and postbuild steps. These scripts are named accordingly.
Brand_Setup - Generates information from website brand pages and extracts it to xlsx spreadsheet
Item_Setup - Generates information from website brand and item pages and extracts to xlsx spreadsheet.
The following is data driven:
Brands_ActionValidation - Feature: In every Page all breadcrumbs must go to correct links [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageBreadcrumbs.template]
Items_ActionValidation - Feature: In every Page all breadcrumbs must go to correct links [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageBreadcrumbs.template]
Items_SEO1 - Feature: The breadcrumbs of all the Pages should match the .xlsx which was generated by Items_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidBreadcrumbs.template]
Brands_SEO1 - Feature: The breadcrumbs of all the Pages should match the .xlsx which was generated by Brands_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidBreadcrumbs.template]
Items_SEO1 - Feature: The Canonical URL of all the Pages should match the .xlsx which was generated by Items_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidCanonical.template]
Brands_SEO1 - Feature: The Canonical URL of all the Pages should match the .xlsx which was generated by Brands_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidCanonical.template]
Items_SEO1 - Feature: The title of all pages should match the .xlsx which was generated by Items_Setup [ https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidTitle.template ]
Brands_SEO1 - Feature: The title of all pages should match the .xlsx which was generated by Brands_Setup [ https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidTitle.template ]
Brands_SEO1 - Feature: The brand group pages has an SEO paragraph matching the .xlsx which was generated by Brands_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/brands/BrandGroupValidCopy.template]
Brands_SEO1 - Feature: The brand group pages have an H1 tag that matches the .xlsx generated by Brands_Setup [ https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/brands/BrandGroupValidHeaderOne.template]
Items_SEO2 - Feature: The MetaDescription of all pages should match the .xlsx which was generated by Items_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidMetaDescription.template]
Brands_SEO2 - Feature: The MetaDescription of all pages should match the .xlsx which was generated by Brands_Setup [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidMetaDescription.template]
Items_SEO2 - Feature: The Meta Description length of all pages is between 1 and 185 characters. [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidMetaDescriptionLength.template]
Brands_SEO2 - Feature: The Meta Description length of all pages is between 1 and 185 characters. [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidMetaDescriptionLength.template]
Items_SEO2 - Feature: The title length of all pages should be under 70 characters. [ https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidTitleLength.template ]
Brands_SEO2 - Feature: The title length of all pages should be under 70 characters. [ https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/base/PageValidTitleLength.template ]
Brands_Validation - Feature: The brand pages should have a visible logo or video.
[https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/brands/BrandValidLogoOrVideo.template]
Items_Validation - Feature: The item pages should have a visible logo or video. [https://github.com/drewbroc/FSSValidationJava/blob/master/src/test/resources/features-templates/items/ItemValidLogoOrVideo.template]