Skip to content
This repository was archived by the owner on Dec 31, 2019. It is now read-only.
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
3 changes: 2 additions & 1 deletion test/itg/1.7/globals.webdriverio.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ module.exports = {
picture_cover: '.iscover',
product_online_toggle: '.switch-input ',
catalogue_filter_by_name_input: '//input[@name="filter_column_name"]',
catalogue_submit_filter_button: '//button[@name="products_filter_submit"]'
catalogue_submit_filter_button: '//button[@name="products_filter_submit"]',
preview_button: '//*[@id="product_form_preview_btn"]'
},
//Order selector
OrderPage:{
Expand Down
38 changes: 38 additions & 0 deletions test/itg/1.7/scenario/BO/create_product.webdriverio.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ describe('The Product Creation', function () {
this.client.call(done);
});

it('should click on preview button before enabling product', function (done) {
global.fctname = this.test.title;
this.client
.waitForExist(this.selector.BO.AddProductPage.preview_button, 90000)
.click(this.selector.BO.AddProductPage.preview_button)
.windowHandles().then(function (handles) {
return this.switchTab(handles.value[handles.value.length - 1]);
})
.waitForExist(this.selector.FO.BuyOrderPage.product_name_details, 90000)
.getText(this.selector.FO.BuyOrderPage.product_name_details).then(function (name) {
should(name[1].toLowerCase()).be.equal('test_nodejs_' + product_id)
})
.pause(3000)
.windowHandles().then(function (handles) {
return this.switchTab(handles.value[0]);
})
.call(done);
});

it('should select product online', function (done) {
global.fctname = this.test.title;
this.client
Expand All @@ -152,6 +171,25 @@ describe('The Product Creation', function () {
.call(done);
});

it('should click on preview button after enabling product', function (done) {
global.fctname = this.test.title;
this.client
.waitForExist(this.selector.BO.AddProductPage.preview_button, 90000)
.click(this.selector.BO.AddProductPage.preview_button)
.windowHandles().then(function (handles) {
return this.switchTab(handles.value[handles.value.length - 1]);
})
.waitForExist(this.selector.FO.BuyOrderPage.product_name_details, 90000)
.getText(this.selector.FO.BuyOrderPage.product_name_details).then(function (name) {
should(name[1].toLowerCase()).be.equal('test_nodejs_' + product_id)
})
.pause(3000)
.windowHandles().then(function (handles) {
return this.switchTab(handles.value[0]);
})
.call(done);
});

it('should save product', function (done) {
global.fctname = this.test.title;
this.client
Expand Down