Skip to content

Development #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: MontgomeryP
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .gitlab-ci.yml
Empty file.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Currently this framework has been developed to run scripts on Chrome Browser and windows Platform
To run the suite on different browser and platform changes in "wdio.conf.js" file will be required.

## Important

Please verify that package.json file with described dependencies presents in the project.

### Tech Stack

* [Selenium Service] - This is a node based CLI library for launching Selenium with WebDrivers support.
Expand Down
3 changes: 0 additions & 3 deletions buildinfo.txt

This file was deleted.

Empty file removed index.js
Empty file.
131 changes: 63 additions & 68 deletions test/javascript/pageobjects/Catalog.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,18 @@ class CatalogPage extends Page {

//get CatalogLink() { return $('#hp > div.main > div.header.box > div.slogan > ul > li:nth-child(3) > a""]'); }
get cart() { return $('#cart')};
/**
* Method to verify visible menu links
*/
verifyVisibleMenuList(allowedMenuItemList, dataTable) {
browser.pause(3000);
if (allowedMenuItemList == "Organization") {
//expect(super.organizationMenuLink.isDisplayed(), "Organization menu is not visible").to.be.true;
super.organizationMenuLink.click();
utilObj.waitForDefaultTimeOut();
var List = dataTable.raw();
//console.log(List)
List.forEach(element => {
element.forEach(item => {
if (item == "Users and devices") {
//browser.saveScreenshot();
//expect(super.userDeviceMenuLink.isDisplayed(), "Users and devices menu is not visible").to.be.true;
//allure.createStep("Admin has access of user and device page")
}
else if (item == "Hierarchies and groups") {
//browser.saveScreenshot();
//expect(super.hieGroupMenuLink.isDisplayed(), "Hierarchies and groups menu is not visible").to.be.true;
//allure.createStep("Admin has access of user and device page")
}
else if (item == "User assignment") {
//browser.saveScreenshot();
//expect(super.userAssignmentLink.isDisplayed(), "User assignment menu is not visible").to.be.true;
//allure.createStep("Admin has access of user and device page")
}
else if (item == "Device pool") {
//browser.saveScreenshot();
//expect(super.devicePoolLink.isDisplayed(), "Device pool menu is not visible").to.be.true;
//allure.createStep("Admin has access of user and device page")
} else {
//browser.saveScreenshot();
throw "Invalid menu item"
}
});
});
}
// else if (allowedMenuItemList == "Dashboard") {

// }
}

/**
* Method to verofy if current page is dashboard else navigate to dashboard
*/
verifyCurrentPage() {
let currentPage = browser.getTitle();
if (currentPage.includes("Dashboard")) {
allure.createStep('User is on Dashboard');
}
else {
// super.dashboardLink.scroll();
super.dashboardLink.click();
//allure.addDescription("open the server instance");
}
}

get firstItemSelect() { return $('#content > table > tbody > tr:nth-child(4) > td:nth-child(1) > a > b')};
get addToCartButton() { return $('#content > div.product-list > div > div.right > div > input')};
get totalCart() {return $('#cart-total')};
get processOrderLink() {return $('#cart > div.content > div.checkout > a:nth-child(2)')};
get processAsGuestButton() {return $('#button-account')};
get firstName() {return $('#payment-address > div.checkout-content > div.left > input:nth-child(4)')};
get lastName() {return $('#payment-address > div.checkout-content > div.left > input:nth-child(9)')};
get email() {return $('#payment-address > div.checkout-content > div.left > input:nth-child(14)')};
get phone() {return $('#payment-address > div.checkout-content > div.left > input:nth-child(19)')};
get address() {return $('#payment-address > div.checkout-content > div.right > input:nth-child(11)')};
get city() {return $('#payment-address > div.checkout-content > div.right > input:nth-child(20)')};
get buttonGuest() {return $('#button-guest')};
/**
* Method to navigate to home page
*/
Expand All @@ -86,15 +39,6 @@ class CatalogPage extends Page {
}
}

/**
* Verify admin can changes its password
*/
verifyAdminCanChangeCredentials(){
utilObj.waitForDefaultTimeOut();
super.adminNameClass.click();
super.adminDivModel.waitForExist(30000);
}

verifyCatalogPage() {
//this.cart.isDisplayed()
if (this.cart.isDisplayed()) {
Expand All @@ -109,6 +53,57 @@ class CatalogPage extends Page {
}
}

selectFirstItem()
{
//browser.pause(5000);
utilObj.waitForDefaultTimeOut();
this.firstItemSelect.click();
}

addItemToCart()

{
//browser.pause(5000);
utilObj.waitForDefaultTimeOut();
this.addToCartButton.click();
}

clickTotalCart()
{
utilObj.waitForDefaultTimeOut();
this.totalCart.click();
}

processWithOrder()
{
utilObj.waitForDefaultTimeOut();
this.processOrderLink.click();
}

processAsGuest() {
utilObj.waitForDefaultTimeOut();
this.processAsGuestButton.click();

}

fillTheGuestPersonalInfo() {
this.firstName.click();
this.firstName.setValue("Maksim")
this.lastName.click();
this.lastName.setValue("KKK");
this.email.click();
this.email.setValue("[email protected]");
this.phone.click();
this.phone.setValue("123455");
this.city.click();
this.city.setValue("tallinn");
this.address.setValue("tallinn 123434");
this.address.click();
//this.buttonGuest.click();
//browser.pause(1000);
}


}
//module.exports = new HomePage();
module.exports = new CatalogPage();
11 changes: 9 additions & 2 deletions test/javascript/pageobjects/Home.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const utilObj = require( '../helper/WaitActions')
class HomePage extends Page {

get catalogLink() { return $('#hp > div.main > div.header.box > div.slogan > ul > li:nth-child(3) > a'); }
get News() { return $("#hp > div.main > div.header.box > div.slogan > ul > li:nth-child(2) > a"); }
get newsLink() { return $('#hp > div.main > div.header.box > div.slogan > ul > li:nth-child(2) > a'); }
get solutionsLink() { return $('#hp > div.main > div.header.box > div.slogan > ul > li:nth-child(4) > a'); }


/**
* Method to verofy if current page is dashboard else navigate to dashboard
Expand Down Expand Up @@ -58,7 +60,12 @@ class HomePage extends Page {

navigateToNewsPage() {
utilObj.waitForDefaultTimeOut();
this.News.click();
this.newsLink.click();
}

navigateToSolutionsPage() {
utilObj.waitForDefaultTimeOut();
this.solutionsLink.click();
}

}
Expand Down
114 changes: 0 additions & 114 deletions test/javascript/pageobjects/News.page.js

This file was deleted.

47 changes: 47 additions & 0 deletions test/javascript/pageobjects/NewsPage.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const Page = require('./Page');
const allure = require('wdio-allure-reporter');
const utilObj = require( '../helper/WaitActions')


class NewsPage extends Page {

get newsTitle() { return $('#hp > div.main > div.content.box > h3:nth-child(1) > strong > i')};


/**
* Method to navigate to home page
*/
navigateToHomepage() {
utilObj.waitForDefaultTimeOut()
if (super.homePageLink.isDisplayed()) {
super.homePageLink.click()
utilObj.waitForPageToLoad()
}
else {
utilObj.waitForDefaultTimeOut()
super.reportsLink.waitForExist(utilObj.defaultwait)
super.reportsLink.click()
utilObj.waitForDefaultTimeOut()
super.homePageLink.waitForExist(utilObj.defaultwait)
super.homePageLink.click()
browser.pause(5000);
}
}

verifyNewsPage() {
//this.cart.isDisplayed()
if (this.newsTitle.isDisplayed()) {
allure.createStep('User is on catalog');
}
else {
// super.dashboardLink.scroll();
utilObj.waitForDefaultTimeOut();
throw "Something went wrong, User is not in catalog"
//super.dashboardLink.click();
//allure.addDescription("open the server instance");
}
}

}
//module.exports = new HomePage();
module.exports = new NewsPage();
6 changes: 4 additions & 2 deletions test/javascript/pageobjects/solutions.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class SolutionsPage extends Page {

//get SolutionsLink() { return $('#hp > div.main > div.content.box > ul:nth-child(1) > li:nth-child(1) > p.more > a); }
get SolutionsTitle() { return $('#SolutionsTatle')};
get galleryShowMoreButtonBlue() { return $('#hp > div.main > div.content.box > ul:nth-child(1) > li:nth-child(1) > p.more > a')};
/**
* Method to verify visible menu links
*/
Expand Down Expand Up @@ -96,9 +97,10 @@ class SolutionsPage extends Page {
}

verifySolutionsPage() {
utilObj.waitForDefaultTimeOut();
//this.Solutions.isDisplayed()
if (this.SolutionPage.isDisplayed()) {
allure.createStep('User is on Solution');
if (this.galleryShowMoreButtonBlue.isDisplayed()) {
allure.createStep('User is on Solution Page');
}
else {
// super.dashboardLink.scroll();
Expand Down
Loading