From 649f32788baf44a6dc0b828901cd8b14d731e473 Mon Sep 17 00:00:00 2001 From: nesrine abdmouleh Date: Thu, 5 Oct 2017 11:17:47 +0100 Subject: [PATCH 1/3] first_commit --- SEOImage_module/.idea/SEO Image.iml | 11 + SEOImage_module/.idea/misc.xml | 4 + SEOImage_module/.idea/modules.xml | 8 + SEOImage_module/.idea/workspace.xml | 542 ++++++++++++++++++ SEOImage_module/test/common.webdriverio.js | 166 ++++++ SEOImage_module/test/globals.webdriverio.js | 115 ++++ SEOImage_module/test/index.webdriverio.js | 40 ++ .../add_EN_rule_all_categories.webdriverio.js | 161 ++++++ ...d_EN_rule_specific_category.webdriverio.js | 163 ++++++ .../add_FR_rule_all_categories.webdriverio.js | 143 +++++ ...d_FR_rule_specific_category.webdriverio.js | 115 ++++ ...edit_EN_rule_all_categories.webdriverio.js | 137 +++++ ...heck_EN_rule_all_categories.webdriverio.js | 204 +++++++ ...k_EN_rule_specific_category.webdriverio.js | 171 ++++++ .../FO/check_all_rules.webdriverio.js | 228 ++++++++ ...ited_EN_rule_all_categories.webdriverio.js | 202 +++++++ 16 files changed, 2410 insertions(+) create mode 100644 SEOImage_module/.idea/SEO Image.iml create mode 100644 SEOImage_module/.idea/misc.xml create mode 100644 SEOImage_module/.idea/modules.xml create mode 100644 SEOImage_module/.idea/workspace.xml create mode 100644 SEOImage_module/test/common.webdriverio.js create mode 100644 SEOImage_module/test/globals.webdriverio.js create mode 100644 SEOImage_module/test/index.webdriverio.js create mode 100644 SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js create mode 100644 SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js create mode 100644 SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js create mode 100644 SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js create mode 100644 SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js create mode 100644 SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js create mode 100644 SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js create mode 100644 SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js create mode 100644 SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js diff --git a/SEOImage_module/.idea/SEO Image.iml b/SEOImage_module/.idea/SEO Image.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/SEOImage_module/.idea/SEO Image.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SEOImage_module/.idea/misc.xml b/SEOImage_module/.idea/misc.xml new file mode 100644 index 0000000..7b4d854 --- /dev/null +++ b/SEOImage_module/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SEOImage_module/.idea/modules.xml b/SEOImage_module/.idea/modules.xml new file mode 100644 index 0000000..2355d57 --- /dev/null +++ b/SEOImage_module/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SEOImage_module/.idea/workspace.xml b/SEOImage_module/.idea/workspace.xml new file mode 100644 index 0000000..5272c03 --- /dev/null +++ b/SEOImage_module/.idea/workspace.xml @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + first_product_home_page + product_name_details + product_name + thumbnail_image + product_price_details + detail_product + reference_product + product_image + btn_appliquez_rulebtn_appliquez_rule + all_product + summer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496227068317 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SEOImage_module/test/common.webdriverio.js b/SEOImage_module/test/common.webdriverio.js new file mode 100644 index 0000000..48cf175 --- /dev/null +++ b/SEOImage_module/test/common.webdriverio.js @@ -0,0 +1,166 @@ +'use strict'; +var client; +var webdriverio = require('webdriverio'); +var globals = require('./globals.webdriverio'); + +var options = { + logLevel: 'silent', + waitForTimeout: 30000, + desiredCapabilities: { + browserName: 'chrome', + }, + port: 4444 +}; + +var options2 = { + logLevel: 'silent', + waitForTimeout: 30000, + desiredCapabilities: { + browserName: 'chrome', + 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, + username: process.env.SAUCE_USERNAME, + access_key: process.env.SAUCE_ACCESS_KEY, + screenResolution: "1680x1050", + platform: "Windows 7", + }, + port: 4445 +}; + +function initCommands(client) { + + client.addCommand('localhost', function (cb) { + this.selector = globals.selector; + client + .url('http://' + URL + 'install-dev') + .call(cb); + }); + + client.addCommand('signinBO', function (cb) { + this.selector = globals.selector; + client + .url('http://' + URL + '/admin-dev/') + .waitForExist(this.selector.BO.LoginPage.login, 90000) + .setValue(this.selector.BO.LoginPage.login, 'demo@prestashop.com') + .setValue(this.selector.BO.LoginPage.password, 'prestashop_demo') + .click(this.selector.BO.LoginPage.login_btn) + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(cb); + }); + + client.addCommand('signinFO', function (cb) { + this.selector = globals.selector; + client + .url('http://' + URL) + .waitForExist(this.selector.FO.HomePage.access_loginFO, 90000) + .click(this.selector.FO.HomePage.access_loginFO) + .waitForExist(this.selector.FO.HomePage.loginFO, 90000) + .setValue(this.selector.FO.HomePage.loginFO, 'pub@prestashop.com') + .setValue(this.selector.FO.HomePage.passwordFO, '123456789') + .click(this.selector.FO.HomePage.login_btnFO) + .call(cb); + }); + + client.addCommand('signoutBO', function (cb) { + this.selector = globals.selector; + client + .deleteCookie() + .call(cb); + }); + + client.addCommand('signoutBO2', function (cb) { + this.selector = globals.selector; + client + .deleteCookie() + .call(cb); + }); + + client.addCommand('signoutFO', function (cb) { + this.selector = globals.selector; + client + .deleteCookie() + .call(cb); + }); + + client.addCommand('changeENlanguageFO', function (cb) { + this.selector = globals.selector; + client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .waitForExist(this.selector.FO.Common.english_btn, 90000) + .click(this.selector.FO.Common.english_btn) + .call(cb); + }); + + client.addCommand('changeFRlanguageFO', function (cb) { + this.selector = globals.selector; + client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .click(this.selector.FO.Common.french_btn) + .pause(3000) + .call(cb); + }); + + client.addCommand('getProductname', function (cb) { + this.selector = globals.selector; + client + .getText(this.selector.FO.ProductPage.product_name).then(function (text) { + global.prod_name = text.toLowerCase(); + }) + .call(cb); + }); + + client.addCommand('getProductprice', function (cb) { + this.selector = globals.selector; + client + .getText(this.selector.FO.ProductPage.product_price).then(function (text) { + global.prod_price = text; + }) + .call(cb); + }); + + client.addCommand('getProductcategory', function (cb) { + this.selector = globals.selector; + client + .getText(this.selector.FO.ProductPage.category_name).then(function (text) { + global.categ_name = text.toLowerCase(); + }) + .call(cb); + }); +} +module.exports = { + getClient: function () { + if (client) { + return client; + } else { + if (typeof saucelabs !== 'undefined' && saucelabs != "None"){ + client = webdriverio + .remote(options2) + .init() + .windowHandleMaximize() + }else{ + client = webdriverio + .remote(options) + .init() + .windowHandleMaximize() + } + initCommands(client); + + return client; + } + }, + after: function (done) { + done(); + }, + take_screenshot: function (done) { + client.saveScreenshot(__dirname +'/screenshots/' + client.desiredCapabilities.browserName + '-Exception' + '_' + global.fctname + '.png'); + }, + initMocha: function () { + this.timeout(900000000); + this.slow(45000); + } +}; diff --git a/SEOImage_module/test/globals.webdriverio.js b/SEOImage_module/test/globals.webdriverio.js new file mode 100644 index 0000000..3e95e64 --- /dev/null +++ b/SEOImage_module/test/globals.webdriverio.js @@ -0,0 +1,115 @@ +'use strict'; +var common = require('./common.webdriverio'); +var path = require('path'); +var should = require('should'); +var argv = require('minimist')(process.argv.slice(2)); + +global.date_time = new Date().getTime(); +global.URL = argv.URL; +global.module_tech_name = argv.MODULE; +global.browser = argv.browser; +global.saucelabs = argv.SAUCELABS; +global._projectdir = path.join(__dirname, '..', '..'); +global.product_id=new Date().getTime(); +global.new_customer_email = 'pub' + date_time + '@prestashop.com'; + +module.exports = { + selector: { + + BO: { + //Back office login page selectors + LoginPage: { + login: '#email', + password: '#passwd', + login_btn: '[name="submitLogin"]', + }, + + //Common selectors + Common: { + menu: '#nav-sidebar', + }, + + //Module page selectors + ModulePage: { + modules_menu: '#subtab-AdminParentModulesSf', + installed_moule_page: '//*[@id="main-div"]/div[1]/div[2]/a[2]', + modules_page_loaded: '.module-search-result-wording', + modules_search: '.pstaggerAddTagInput.module-tags-input', + modules_search_button: '//*[@id="main-div"]/div[3]/div[2]/div/div[2]/div/div[5]/div/div[1]/div/button', + module_configuration_btn: '//*[@id="modules-list-container-all"]/div[1]/div/div/div[5]/div[2]/form/button', + nbr_module: '//*[@id="main-div"]/div[3]/div[2]/div/div[2]/div/div[7]/span[1]', + }, + + //Module page configuration selectors + ModuleConfiguration: { + seo_config_panel: '//*[@id="modulecontent"]/div[1]/div[1]/a[2]', + add_rules_btn: '.process-icon-new', + rule_name: '//*[@id="rule_name"]', + rule_lang_btn: '//*[@id="step-1"]/div[3]/div/div[1]/button', + rule_english_lang: '//*[@id="step-1"]/div[3]/div/div[1]/div/ul/li[1]', + rule_french_lang: '//*[@id="step-1"]/div[3]/div/div[1]/div/ul/li[2]', + next_step_rules: '//*[@id="next-step"]', + all_catalog_btn_rules: '//*[@id="radios-0"]/label/input', + rules_condition: '//*[@id="legend"]', + save_rules: '//*[@id="btn-save"]', + close_green_validation: '/html/body/div[6]/div/div/div[1]/div/div[2]/button', + apply_rule1_btn: '//*[@id="table-metas-1"]/tbody/tr/td[7]/div/div/a', + apply_rule2_btn: '//*[@id="table-metas-1"]/tbody/tr[2]/td[7]/div/div/a', + apply_rule3_btn: '//*[@id="table-metas-1"]/tbody/tr[3]/td[7]/div/div/a', + apply_rule4_btn: '//*[@id="table-metas-1"]/tbody/tr[4]/td[7]/div/div/a', + apply_all_rules: '//*[@id="table-metas-1"]/a[1]', + dropdownlist_btn: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/button', + edit_rule_btn: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/ul/li[1]/a', + expan_all_btn: '//*[@id="expandall"]', + evening_dress_checkbox: '//*[@id="category_10"]/a/i[1]', + }, + }, + FO : { + //Common selectors + Common: { + lang_btn: '//*[@id="_desktop_language_selector"]/div/div/button', + english_btn: '//*[@id="_desktop_language_selector"]/div/div/ul/li[1]/a', + french_btn: '//*[@id="_desktop_language_selector"]/div/div/ul/li[2]/a', + }, + + //Home page selectors + HomePage: { + access_loginFO: 'div.user-info > a', + loginFO: '//*[@id="login-form"]/section/div[1]/div[1]/input', + passwordFO: '//*[@id="login-form"]/section/div[2]/div[1]/div/input', + login_btnFO: '//*[@id="login-form"]/footer/button', + logoutFO: '.logout', + logo_home_pageFO: '.logo.img-responsive', + all_product: '//*[@id="content"]/section/a', + }, + + //Category page selectors + CategoryPage: { + first_product: '//*[@id="js-product-list"]/div[1]/article[1]/div/a/img', + category_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li/div[1]', + category_women_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li/div[1]/i[1]', + tops_category: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[1]/a', + dresses_category: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[2]/a', + dresses_category_list: '//*[@id="exCollapsingNavbar3"]/ul/li[2]/span/i[1]', + evening_dresses_category: '//*[@id="exCollapsingNavbar8"]/ul/li[2]/a', + casual_dresses_category: '//*[@id="exCollapsingNavbar8"]/ul/li[1]/a', + dresses_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[2]/div[1]/i[1]', + }, + + //Product page selectors + ProductPage: { + product_name: '//*[@id="main"]/div[1]/div[2]/h1', + product_price: '//*[@id="main"]/div[1]/div[2]/div[1]/div[1]/div/span', + product_image: '//*[@id="product-modal"]/div/div/div/figure/img', + thumbnail_image: '//*[@id="content"]/div[1]/div[2]/ul/li[1]/img', + category_name: '//*[@id="wrapper"]/div/nav/ol/li[4]/a/span', + women_category: '//*[@id="wrapper"]/div/nav/ol/li[2]/a', + }, + } + + }, + shouldExist: function(err, existing) { + should(err).be.not.defined; + should(existing).be.true; + } +}; \ No newline at end of file diff --git a/SEOImage_module/test/index.webdriverio.js b/SEOImage_module/test/index.webdriverio.js new file mode 100644 index 0000000..25e1888 --- /dev/null +++ b/SEOImage_module/test/index.webdriverio.js @@ -0,0 +1,40 @@ +'use strict'; +var should = require('should'); +var common = require('./common.webdriverio'); + + +describe('Allscenario', function(){ + common.initMocha.call(this); + + before(function (done) { + this.client = common.getClient(); + this.client.call(done); + }); + + after(function (done) { + this.client + .end() + .call(done); + }); + + // Add EN rule in all categories in BO and check it in FO + /*require('./scenario/BO/add_EN_rule_all_categories.webdriverio'); + require('./scenario/FO/check_EN_rule_all_categories.webdriverio');*/ + + // Edit EN rule in all categories in BO and check it in FO + /*require('./scenario/BO/edit_EN_rule_all_categories.webdriverio'); + require('./scenario/FO/check_edited_EN_rule_all_categories.webdriverio');*/ + + // Add EN rule in a specific category in BO and check it in FO + /*require('./scenario/BO/add_EN_rule_specific_category.webdriverio'); + require('./scenario/FO/check_EN_rule_specific_category.webdriverio');*/ + + // Add FR rule in all categories and in specific category + /*require('./scenario/BO/add_FR_rule_all_categories.webdriverio'); + require('./scenario/BO/add_FR_rule_specific_category.webdriverio');*/ + + //Check all rules in FO + require('./scenario/FO/check_all_rules.webdriverio') + + +}); diff --git a/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js new file mode 100644 index 0000000..153c80c --- /dev/null +++ b/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js @@ -0,0 +1,161 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Add rule in all categories when the front is in english ', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + describe('Log in in Back Office', function(done){ + it('should log in successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signinBO() + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(done); + }); + }); + + describe('Go to the module configuration page', function(done) { + it('should go to the modules page', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .click(this.selector.BO.ModulePage.modules_menu) + .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) + .call(done); + }); + + it('should go to the module', function (done) { + global.fctname = this.test.title; + + this.client + .click(this.selector.BO.ModulePage.installed_moule_page) + .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) + .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") + .click(this.selector.BO.ModulePage.modules_search_button) + .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { + global.nbr = parseInt(text[0]); + if (global.nbr == 0) { + done(new Error('The module you are searching for does not exist!')); + } + else + done(); + }) + }); + }); + + describe('The configuration of the module', function(done) { + it('should go to the module configuration page ', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) + .click(this.selector.BO.ModulePage.module_configuration_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) + .click(this.selector.BO.ModuleConfiguration.seo_config_panel) + .call(done); + }); + + it('should click on add new rule', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.add_rules_btn) + .call(done); + }); + + it('should add the rule name', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) + .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testEN1') + .call(done); + }); + + it('should choose the english language', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.rule_english_lang, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_english_lang) + .call(done); + }); + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done); + }); + + it('should selelct all catlgories', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules) + .call(done) + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done) + }); + + it('should write the rule condition', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) + .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_name}{product_reduce_price} EN1') + .call(done); + }); + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rules) + .call(done); + }); + + it('should close the green validatlon ', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .click(this.selector.BO.ModuleConfiguration.close_green_validation) + .call(done); + }); + + it('should click on apply rule ', function(done){ + global.fctname= this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule1_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.apply_rule1_btn) + .pause(5000) + .call(done); + }); + }); + + describe('Log out in Back Office', function(done){ + it('should log out successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signoutBO() + .call(done); + }); + }); +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js new file mode 100644 index 0000000..733d72e --- /dev/null +++ b/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js @@ -0,0 +1,163 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Add rule in a specific category when the front is in english ', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + describe('Log in in Back Office', function(done){ + it('should log in successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signinBO() + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(done); + }); + }); + + describe('Go to the module configuration page', function(done) { + it('should go to the modules page', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .click(this.selector.BO.ModulePage.modules_menu) + .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) + .call(done); + }); + + it('should go to the module', function (done) { + global.fctname = this.test.title; + + this.client + .click(this.selector.BO.ModulePage.installed_moule_page) + .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) + .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") + .click(this.selector.BO.ModulePage.modules_search_button) + .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { + global.nbr = parseInt(text[0]); + if (global.nbr == 0) { + done(new Error('The module you are searching for does not exist!')); + } + else + done(); + }) + }); + }); + + describe('The configuration of the module', function(done) { + it('should go to the module configuration page ', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) + .click(this.selector.BO.ModulePage.module_configuration_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) + .click(this.selector.BO.ModuleConfiguration.seo_config_panel) + .call(done); + }); + + it('should click on add new rule', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.add_rules_btn) + .call(done); + }); + + it('should add the rule name', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) + .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testEN2') + .call(done); + }); + + it('should choose the english language', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.rule_english_lang, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_english_lang) + .call(done); + }); + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done); + }); + + it('should select Evening dresses category', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.expan_all_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.expan_all_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.evening_dress_checkbox, 90000) + .click(this.selector.BO.ModuleConfiguration.evening_dress_checkbox) + .call(done) + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done) + }); + + it('should write the rule condition', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) + .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} EN2') + .call(done); + }); + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rules) + .call(done); + }); + + it('should close the green validation ', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .click(this.selector.BO.ModuleConfiguration.close_green_validation) + .call(done); + }); + + it('should click on apply all rules ', function(done){ + global.fctname= this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule2_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.apply_rule2_btn) + .pause(5000) + .call(done); + }); + }); + + describe('Log out in Back Office', function(done){ + it('should log out successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signoutBO() + .call(done); + }); + }); +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js new file mode 100644 index 0000000..eb08094 --- /dev/null +++ b/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js @@ -0,0 +1,143 @@ + +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Add rule in all categories when the front is in french ', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + describe('Log in in Back Office', function(done){ + it('should log in successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signinBO() + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(done); + }); + }); + + describe('Go to the module configuration page', function(done) { + it('should go to the modules page', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .click(this.selector.BO.ModulePage.modules_menu) + .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) + .call(done); + }); + + it('should go to the module', function (done) { + global.fctname = this.test.title; + + this.client + .click(this.selector.BO.ModulePage.installed_moule_page) + .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) + .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") + .click(this.selector.BO.ModulePage.modules_search_button) + .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { + global.nbr = parseInt(text[0]); + if (global.nbr == 0) { + done(new Error('The module you are searching for does not exist!')); + } + else + done(); + }) + }); + }); + + describe('The configuration of the module', function(done) { + it('should go to the module configuration page ', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) + .click(this.selector.BO.ModulePage.module_configuration_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) + .click(this.selector.BO.ModuleConfiguration.seo_config_panel) + .call(done); + }); + + it('should click on add new rule', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.add_rules_btn) + .call(done); + }); + + it('should add the rule name', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) + .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testFR1') + .call(done); + }); + + it('should choose the french language', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.rule_french_lang, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_french_lang) + .call(done); + }); + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done); + }); + + it('should selelct all catlgories', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules) + .call(done) + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done) + }); + + it('should write the rule condition', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) + .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_name}{product_reference} FR1') + .call(done); + }); + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rules) + .call(done); + }); + + it('should close the green validation ', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .click(this.selector.BO.ModuleConfiguration.close_green_validation) + .call(done); + }); + }); +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js new file mode 100644 index 0000000..922a399 --- /dev/null +++ b/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js @@ -0,0 +1,115 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Add rule in a specific category when the front is in french ', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + describe('The add of the french rule', function(done) { + it('should click on add new rule', function(done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.add_rules_btn) + .call(done); + }); + + it('should add the rule name', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) + .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testFR2') + .call(done); + }); + + it('should choose the french language', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.rule_french_lang, 90000) + .click(this.selector.BO.ModuleConfiguration.rule_french_lang) + .call(done); + }); + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done); + }); + + it('should select Evening dresses category', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.expan_all_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.expan_all_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.evening_dress_checkbox, 90000) + .click(this.selector.BO.ModuleConfiguration.evening_dress_checkbox) + .call(done) + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done) + }); + + it('should write the rule condition', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) + .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} FR2') + .call(done); + }); + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rules) + .call(done); + }); + + it('should close the green validation ', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .click(this.selector.BO.ModuleConfiguration.close_green_validation) + .call(done); + }); + + it('should click on apply all rules ', function(done){ + global.fctname= this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.apply_all_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.apply_all_rules) + .pause(5000) + .call(done); + }); + }); + + describe('Log out in Back Office', function(done){ + it('should log out successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signoutBO() + .call(done); + }); + }); +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js new file mode 100644 index 0000000..d2c5998 --- /dev/null +++ b/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js @@ -0,0 +1,137 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Edit the english rule in all categories ', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + describe('Log in in Back Office', function(done){ + it('should log in successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signinBO() + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(done); + }); + }); + + describe('Go to the module configuration page', function(done) { + it('should go to the modules page', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .click(this.selector.BO.ModulePage.modules_menu) + .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) + .call(done); + }); + + it('should go to the module', function (done) { + global.fctname = this.test.title; + + this.client + .click(this.selector.BO.ModulePage.installed_moule_page) + .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) + .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") + .click(this.selector.BO.ModulePage.modules_search_button) + .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { + global.nbr = parseInt(text[0]); + if (global.nbr == 0) { + done(new Error('The module you are searching for does not exist!')); + } + else + done(); + }) + }); + }); + + describe('The configuration of the module', function(done) { + it('should go to the module configuration page ', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) + .click(this.selector.BO.ModulePage.module_configuration_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) + .click(this.selector.BO.ModuleConfiguration.seo_config_panel) + .call(done); + }); + + it('should click on edit rule', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.dropdownlist_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.dropdownlist_btn) + .waitForExist(this.selector.BO.ModuleConfiguration.edit_rule_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.edit_rule_btn) + .call(done); + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done); + }); + + it('should click on next button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rules) + .call(done) + }); + + it('should edit the rule condition', function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) + .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{default_cat_name} EN1') + .call(done); + }); + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rules) + .call(done); + }); + + it('should close the green validatlon ', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .click(this.selector.BO.ModuleConfiguration.close_green_validation) + .call(done); + }); + + it('should click on apply rule ', function(done){ + global.fctname= this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule1_btn, 90000) + .click(this.selector.BO.ModuleConfiguration.apply_rule1_btn) + .pause(5000) + .call(done); + }); + }); + + describe('Log out in Back Office', function(done){ + it('should log out successfully in BO', function(done){ + global.fctname= this.test.title; + this.client + .signoutBO() + .call(done); + }); + }); +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js new file mode 100644 index 0000000..5dc88c8 --- /dev/null +++ b/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js @@ -0,0 +1,204 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Verify the rule applied to all categories when the shop is in english', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + it('should open the shop and loggin FO', function(done) { + global.fctname = this.test.title; + this.client + .signinFO() + .call(done); + }); + + describe('Verify the rule in all categories when the shop is in english', function(done){ + it('should change the shop language to english', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .waitForExist(this.selector.FO.Common.english_btn, 90000) + .click(this.selector.FO.Common.english_btn) + .call(done); + }); + + it('should go to all product page', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) + .click(this.selector.FO.HomePage.logo_home_pageFO) + .scroll(0, 400) + .pause(5000) + .waitForExist(this.selector.FO.HomePage.all_product, 90000) + .click(this.selector.FO.HomePage.all_product) + .call(done); + }); + + it('should select the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.category_list, 90000) + .click(this.selector.FO.CategoryPage.category_list) + .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) + .click(this.selector.FO.CategoryPage.tops_category) + .call(done); + }); + + it('should select the first product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductname() + .getProductprice() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); + }) + .call(done); + }); + + it('should select the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) + .click(this.selector.FO.CategoryPage.dresses_category) + .call(done); + }); + + it('should select the first product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductname() + .getProductprice() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); + }) + .call(done); + }); + }); + + describe('Verify the rule in all categories when the shop is in french', function(done){ + it('should change the shop language to french', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .click(this.selector.FO.Common.french_btn) + .pause(3000) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should select the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) + .click(this.selector.FO.CategoryPage.dresses_category) + .call(done); + }); + + it('should select the first product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + }); + + + describe('Log out in Front Office', function(done){ + it('should logout successfully in FO', function(done){ + global.fctname= this.test.title; + this.client + .signoutFO() + .call(done); + }); + }); + +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js new file mode 100644 index 0000000..ccf61bb --- /dev/null +++ b/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js @@ -0,0 +1,171 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Verify the rule applied to a specific category when the shop is in english', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + it('should open the shop and loggin FO', function(done) { + global.fctname = this.test.title; + this.client + .signinFO() + .call(done); + }); + + describe('Verify the rule in a specific category when the shop is in english', function(done){ + it('should change the shop language to english', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .waitForExist(this.selector.FO.Common.english_btn, 90000) + .click(this.selector.FO.Common.english_btn) + .call(done); + }); + + it('should go to all product page', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) + .click(this.selector.FO.HomePage.logo_home_pageFO) + .scroll(0, 400) + .pause(5000) + .waitForExist(this.selector.FO.HomePage.all_product, 90000) + .click(this.selector.FO.HomePage.all_product) + .call(done); + }); + + it('should select the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.category_women_list, 90000) + .click(this.selector.FO.CategoryPage.category_women_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.dresses_category_list, 90000) + .click(this.selector.FO.CategoryPage.dresses_category_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) + .click(this.selector.FO.CategoryPage.evening_dresses_category) + .call(done); + }); + + it('should select a product in the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal("€50.99€50.99 EN2"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Evening Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal("€50.99€50.99 EN2"); + }) + .call(done); + }); + + it('should select the category Casual Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.dresses_list, 90000) + .click(this.selector.FO.CategoryPage.dresses_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.casual_dresses_category, 90000) + .click(this.selector.FO.CategoryPage.casual_dresses_category) + .call(done); + }); + + it('should select a product in the category Casual Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Casual Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal("Casual Dresses EN1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Casual Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal("Casual Dresses EN1"); + }) + .call(done); + }); + }); + + describe('Verify the rule in a specific category when the shop is in french', function(done){ + it('should change the shop language to french', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .click(this.selector.FO.Common.french_btn) + .pause(3000) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Evening Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + }); + + describe('Log out in Front Office', function(done){ + it('should logout successfully in FO', function(done){ + global.fctname= this.test.title; + this.client + .signoutFO() + .call(done); + }); + }); + +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js b/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js new file mode 100644 index 0000000..6024c1b --- /dev/null +++ b/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js @@ -0,0 +1,228 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Verify all rules applied when the shop is in english', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + it('should open the shop and loggin FO', function(done) { + global.fctname = this.test.title; + this.client + .signinFO() + .call(done); + }); + + describe('Verify the rule when the shop is in english', function(done){ + it('should change the shop language to english', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .waitForExist(this.selector.FO.Common.english_btn, 90000) + .click(this.selector.FO.Common.english_btn) + .call(done); + }); + + it('should go to all product page', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) + .click(this.selector.FO.HomePage.logo_home_pageFO) + .scroll(0, 400) + .pause(5000) + .waitForExist(this.selector.FO.HomePage.all_product, 90000) + .click(this.selector.FO.HomePage.all_product) + .call(done); + }); + + it('should select the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.category_women_list, 90000) + .click(this.selector.FO.CategoryPage.category_women_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.dresses_category_list, 90000) + .click(this.selector.FO.CategoryPage.dresses_category_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) + .click(this.selector.FO.CategoryPage.evening_dresses_category) + .call(done); + }); + + it('should select the product with the reference demo_4 in the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .call(done); + }); + + it('should verify the rule in the cover image of the product Printed Dress', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal("€50.99€50.99 EN2"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product Printed Dress ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal("€50.99€50.99 EN2"); + }) + .call(done); + }); + + it('should select the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) + .click(this.selector.FO.CategoryPage.tops_category) + .call(done); + }); + + it('should select the first product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductcategory() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + }); + + describe('Verify the rule in all categories when the shop is in french', function(done){ + it('should change the shop language to french', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .click(this.selector.FO.Common.french_btn) + .pause(3000) + .call(done); + }); + + it('should select the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.dresses_list, 90000) + .click(this.selector.FO.CategoryPage.dresses_list) + .pause(3000) + .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) + .click(this.selector.FO.CategoryPage.evening_dresses_category) + .call(done); + }); + + it('should select the product with the reference demo_4 in the category Evening Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductname() + .call(done); + }); + + it('should verify the rule in the cover image of the product Printed Dress', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + "demo_4 fr1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product Printed Dress', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + "demo_4 fr1"); + }) + .call(done); + }); + + it('should select the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) + .click(this.selector.FO.CategoryPage.tops_category) + .call(done); + }); + + it('should select the first product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductname() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + "demo_1 fr1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.prod_name + "demo_1 fr1"); + }) + .call(done); + }); + }); + + describe('Log out in Front Office', function(done){ + it('should logout successfully in FO', function(done){ + global.fctname= this.test.title; + this.client + .signoutFO() + .call(done); + }); + }); + +}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js new file mode 100644 index 0000000..22478f0 --- /dev/null +++ b/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js @@ -0,0 +1,202 @@ +'use strict'; +var should = require('should'); +var common = require('../../common.webdriverio'); +var globals = require('../../globals.webdriverio.js'); + +describe('Verify the edited rule applied to all categories when the shop is in english', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + process.on('uncaughtException', common.take_screenshot); + process.on('ReferenceError', common.take_screenshot); + after(common.after); + + it('should open the shop and loggin FO', function(done) { + global.fctname = this.test.title; + this.client + .signinFO() + .call(done); + }); + + describe('Verify the edited rule in all categories when the shop is in english', function(done){ + it('should change the shop language to english', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .waitForExist(this.selector.FO.Common.english_btn, 90000) + .click(this.selector.FO.Common.english_btn) + .call(done); + }); + + it('should go to all product page', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) + .click(this.selector.FO.HomePage.logo_home_pageFO) + .scroll(0, 400) + .pause(5000) + .waitForExist(this.selector.FO.HomePage.all_product, 90000) + .click(this.selector.FO.HomePage.all_product) + .call(done); + }); + + it('should select the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.category_list, 90000) + .click(this.selector.FO.CategoryPage.category_list) + .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) + .click(this.selector.FO.CategoryPage.tops_category) + .call(done); + }); + + it('should select the first product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductcategory() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + + it('should select the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) + .click(this.selector.FO.CategoryPage.dresses_category) + .call(done); + }); + + it('should select the first product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .getProductcategory() + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text.toLowerCase()).be.equal(global.categ_name + " en1"); + }) + .call(done); + }); + }); + + describe('Verify the rule in all categories when the shop is in french', function(done){ + it('should change the shop language to french', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForExist(this.selector.FO.Common.lang_btn, 90000) + .click(this.selector.FO.Common.lang_btn) + .pause(3000) + .click(this.selector.FO.Common.french_btn) + .pause(3000) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Tops', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should select the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.ProductPage.women_category, 90000) + .click(this.selector.FO.ProductPage.women_category) + .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) + .click(this.selector.FO.CategoryPage.dresses_category) + .call(done); + }); + + it('should select the first product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) + .click(this.selector.FO.CategoryPage.first_product) + .call(done); + }); + + it('should verify the rule in the cover image of the product in the category Dresses', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + + it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { + should(text).be.equal(""); + }) + .call(done); + }); + }); + + + describe('Log out in Front Office', function(done){ + it('should logout successfully in FO', function(done){ + global.fctname= this.test.title; + this.client + .signoutFO() + .call(done); + }); + }); + +}); \ No newline at end of file From 9464fb212c6631cf8a4ce614dbad8ab3cc1400c4 Mon Sep 17 00:00:00 2001 From: nesrine abdmouleh Date: Thu, 5 Oct 2017 11:26:49 +0100 Subject: [PATCH 2/3] fix_index.webdriverio --- SEOImage_module/test/index.webdriverio.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SEOImage_module/test/index.webdriverio.js b/SEOImage_module/test/index.webdriverio.js index 25e1888..af855fd 100644 --- a/SEOImage_module/test/index.webdriverio.js +++ b/SEOImage_module/test/index.webdriverio.js @@ -18,20 +18,20 @@ describe('Allscenario', function(){ }); // Add EN rule in all categories in BO and check it in FO - /*require('./scenario/BO/add_EN_rule_all_categories.webdriverio'); - require('./scenario/FO/check_EN_rule_all_categories.webdriverio');*/ + require('./scenario/BO/add_EN_rule_all_categories.webdriverio'); + require('./scenario/FO/check_EN_rule_all_categories.webdriverio'); // Edit EN rule in all categories in BO and check it in FO - /*require('./scenario/BO/edit_EN_rule_all_categories.webdriverio'); - require('./scenario/FO/check_edited_EN_rule_all_categories.webdriverio');*/ + require('./scenario/BO/edit_EN_rule_all_categories.webdriverio'); + require('./scenario/FO/check_edited_EN_rule_all_categories.webdriverio'); // Add EN rule in a specific category in BO and check it in FO - /*require('./scenario/BO/add_EN_rule_specific_category.webdriverio'); - require('./scenario/FO/check_EN_rule_specific_category.webdriverio');*/ + require('./scenario/BO/add_EN_rule_specific_category.webdriverio'); + require('./scenario/FO/check_EN_rule_specific_category.webdriverio'); // Add FR rule in all categories and in specific category - /*require('./scenario/BO/add_FR_rule_all_categories.webdriverio'); - require('./scenario/BO/add_FR_rule_specific_category.webdriverio');*/ + require('./scenario/BO/add_FR_rule_all_categories.webdriverio'); + require('./scenario/BO/add_FR_rule_specific_category.webdriverio'); //Check all rules in FO require('./scenario/FO/check_all_rules.webdriverio') From d68f6dc9351378aad2eef21907c4fde7fec6e371 Mon Sep 17 00:00:00 2001 From: nesrine abdmouleh Date: Fri, 13 Oct 2017 16:24:20 +0100 Subject: [PATCH 3/3] applicate_first_architecture --- .../test/scenario/BO/enable_module.js | 4 +- ...check_default_configuration.webdriverio.js | 2 +- ...he_notification_prestafraud.webdriverio.js | 2 +- README.md | 2 +- SEOImage_module/.idea/SEO Image.iml | 11 - SEOImage_module/.idea/misc.xml | 4 - SEOImage_module/.idea/modules.xml | 8 - SEOImage_module/.idea/workspace.xml | 542 ------------------ .../campaings/launch-seoimage-module-tests.js | 245 ++++++++ SEOImage_module/test/common.webdriverio.js | 49 +- SEOImage_module/test/globals.webdriverio.js | 91 ++- SEOImage_module/test/index.webdriverio.js | 40 -- .../add_EN_rule_all_categories.webdriverio.js | 161 ------ ...d_EN_rule_specific_category.webdriverio.js | 163 ------ .../add_FR_rule_all_categories.webdriverio.js | 143 ----- ...d_FR_rule_specific_category.webdriverio.js | 115 ---- ...edit_EN_rule_all_categories.webdriverio.js | 137 ----- ...heck_EN_rule_all_categories.webdriverio.js | 204 ------- ...k_EN_rule_specific_category.webdriverio.js | 171 ------ .../FO/check_all_rules.webdriverio.js | 228 -------- ...ited_EN_rule_all_categories.webdriverio.js | 202 ------- .../actionbloc/action-module.webdriverio.js | 48 ++ .../actionbloc/add-rule.webdriverio.js | 98 ++++ .../actionbloc/authentication.webdriverio.js | 48 ++ .../actionbloc/check-rule.webdriverio.js | 61 ++ .../actionbloc/set-language.webdriverio.js | 27 + .../BO/check_account_creation.webdriverio.js | 2 +- ...heck_login_to_upela_account.webdriverio.js | 2 +- .../BO/check_shop_creation.webdriverio.js | 2 +- 29 files changed, 586 insertions(+), 2226 deletions(-) delete mode 100644 SEOImage_module/.idea/SEO Image.iml delete mode 100644 SEOImage_module/.idea/misc.xml delete mode 100644 SEOImage_module/.idea/modules.xml delete mode 100644 SEOImage_module/.idea/workspace.xml create mode 100644 SEOImage_module/test/campaings/launch-seoimage-module-tests.js delete mode 100644 SEOImage_module/test/index.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js delete mode 100644 SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js create mode 100644 SEOImage_module/test/scenario/actionbloc/action-module.webdriverio.js create mode 100644 SEOImage_module/test/scenario/actionbloc/add-rule.webdriverio.js create mode 100644 SEOImage_module/test/scenario/actionbloc/authentication.webdriverio.js create mode 100644 SEOImage_module/test/scenario/actionbloc/check-rule.webdriverio.js create mode 100644 SEOImage_module/test/scenario/actionbloc/set-language.webdriverio.js diff --git a/Faviconotification/test/scenario/BO/enable_module.js b/Faviconotification/test/scenario/BO/enable_module.js index a26ccf1..dde6848 100644 --- a/Faviconotification/test/scenario/BO/enable_module.js +++ b/Faviconotification/test/scenario/BO/enable_module.js @@ -18,7 +18,7 @@ describe('The Activation of the Favicon Notification Module', function () { describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .signinBO() .waitForExist(this.selector.BO.Common.menu, 90000) @@ -72,7 +72,7 @@ describe('The Activation of the Favicon Notification Module', function () { }); describe('Log out in Back Office', function (done) { - it('should log out successfully in BO', function (done) { + it('should log out successfully in actionbloc', function (done) { this.client .signoutBO() .call(done); diff --git a/Prestafraud/test/scenario/BO/check_default_configuration.webdriverio.js b/Prestafraud/test/scenario/BO/check_default_configuration.webdriverio.js index 60f3c31..80a83e4 100644 --- a/Prestafraud/test/scenario/BO/check_default_configuration.webdriverio.js +++ b/Prestafraud/test/scenario/BO/check_default_configuration.webdriverio.js @@ -15,7 +15,7 @@ describe('Test case n°1 = Check the default configuration', function () { after(common.after); describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .signinBO() .waitForExist(this.selector.BO.Common.menu, 90000) diff --git a/Prestafraud/test/scenario/BO/check_the_notification_prestafraud.webdriverio.js b/Prestafraud/test/scenario/BO/check_the_notification_prestafraud.webdriverio.js index 5210e39..d934f34 100644 --- a/Prestafraud/test/scenario/BO/check_the_notification_prestafraud.webdriverio.js +++ b/Prestafraud/test/scenario/BO/check_the_notification_prestafraud.webdriverio.js @@ -15,7 +15,7 @@ describe('Verify the Configuration of the Module', function () { after(common.after); describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .signinBO() .waitForExist(this.selector.BO.Common.menu, 90000) diff --git a/README.md b/README.md index 568066b..3a01258 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ b) How to launch tests - Go to the folder of the module you want to test and execute the following line: - Launch tests : - mocha index.webdriverio.js --URL=presto200917.staging-prestashopready.net --EMAIL=remi.gaillard@prestashop.com --PWD=abcd1234 + mocha launch-seoimage-module-tests.js --URL=presto200917.staging-prestashopready.net --EMAIL=remi.gaillard@prestashop.com --PWD=abcd1234 - URL: Front office URL of your prestashop website (without the “http://”) - Email : Admin email - PWD : Admin password diff --git a/SEOImage_module/.idea/SEO Image.iml b/SEOImage_module/.idea/SEO Image.iml deleted file mode 100644 index 6711606..0000000 --- a/SEOImage_module/.idea/SEO Image.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/SEOImage_module/.idea/misc.xml b/SEOImage_module/.idea/misc.xml deleted file mode 100644 index 7b4d854..0000000 --- a/SEOImage_module/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/SEOImage_module/.idea/modules.xml b/SEOImage_module/.idea/modules.xml deleted file mode 100644 index 2355d57..0000000 --- a/SEOImage_module/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/SEOImage_module/.idea/workspace.xml b/SEOImage_module/.idea/workspace.xml deleted file mode 100644 index 5272c03..0000000 --- a/SEOImage_module/.idea/workspace.xml +++ /dev/null @@ -1,542 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - first_product_home_page - product_name_details - product_name - thumbnail_image - product_price_details - detail_product - reference_product - product_image - btn_appliquez_rulebtn_appliquez_rule - all_product - summer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1496227068317 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SEOImage_module/test/campaings/launch-seoimage-module-tests.js b/SEOImage_module/test/campaings/launch-seoimage-module-tests.js new file mode 100644 index 0000000..c4de00f --- /dev/null +++ b/SEOImage_module/test/campaings/launch-seoimage-module-tests.js @@ -0,0 +1,245 @@ +'use strict'; +var should = require('should'); +var common = require('../common.webdriverio'); +var globals = require('../globals.webdriverio.js'); +var language = require('../scenario/actionbloc/set-language.webdriverio'); +var module = require('./../scenario/actionbloc/action-module.webdriverio'); +var authentication = require('../scenario/actionbloc/authentication.webdriverio'); +var rule = require('./../scenario/actionbloc/add-rule.webdriverio'); +var checkRule = require('../scenario/actionbloc/check-rule.webdriverio'); + +describe('Allscenario', function(){ + common.initMocha.call(this); + + before(function (done) { + this.client = common.getClient(); + this.client.call(done); + }); + + after(function (done) { + this.client + .end() + .call(done); + }); + + describe('Test case n°1 : Add and check english rule in all categories', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + + after(common.after); + + describe('Add english rule in all categories', function() { + authentication.loginBO(); + module.searchModule("seoimage"); + describe('Configure the SEO Image module', function () { + module.configureModule(); + rule.addRule('testEN1'); + language.selectRuleLanguage(1 , " english"); + rule.clickNextButton(); + rule.allCategory(); + rule.clickNextButton(); + rule.ruleCondition('{product_name}{product_reduce_price} EN1',' "{product_name}{product_reduce_price} EN1"' ); + rule.saveForm(); + rule.closeGreenValidation(); + rule.applyRule(1); + }); + authentication.logoutBO(); + }); + + describe('Check english rule in all categories in FO', function() { + authentication.openShop(); + describe('Check that the rule exists when the shop is in english', function () { + language.selectLanguageFO(1 , " english"); + checkRule.selectSleevesTshirtProduct(); + checkRule.verifRule("Faded Short Sleeves T-shirt€19.81 EN1" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + checkRule.selectPrintedDressCasualDressesCategory(); + checkRule.verifRule("Printed Dress€31.19 EN1" , ' "Printed Dress" product in the category "Casual Dresses"'); + }); + + describe('Check that the rule does not exist when the shop is in french', function () { + language.selectLanguageFO(2 , " french"); + checkRule.verifRule("" , ' "Printed Dress" product in the category Casual "Dresses"'); + checkRule.selectSleevesTshirtProduct(); + checkRule.verifRule("" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + }); + }); + }); + + describe('Test case n°2 : Edit and check english rule in all categories', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + + after(common.after); + + describe('Edit english rule in all categories', function() { + authentication.loginBO(); + module.searchModule("seoimage"); + describe('Configure the SEO Image module', function () { + module.configureModule(); + it('should click on "edit" rule', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.dropdown_button, 90000) + .click(this.selector.BO.ModuleConfiguration.dropdown_button) + .waitForExist(this.selector.BO.ModuleConfiguration.edit_rule_button, 90000) + .click(this.selector.BO.ModuleConfiguration.edit_rule_button) + .call(done); + }); + rule.clickNextButton(); + rule.clickNextButton(); + rule.ruleCondition('{default_cat_name} EN1',' "{default_cat_name} EN1"'); + rule.saveForm(); + rule.closeGreenValidation(); + rule.applyRule(1); + }); + authentication.logoutBO(); + }); + + describe('Check english rule in all categories in FO', function() { + authentication.openShop(); + describe('Check that the rule exists when the shop is in english', function () { + language.selectLanguageFO(1 , " english"); + checkRule.selectSleevesTshirtProduct(); + checkRule.verifRule("T-shirts EN1" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + checkRule.selectPrintedDressCasualDressesCategory(); + checkRule.verifRule("Casual Dresses EN1" , ' "Printed Dress" product in the category "Casual Dresses"'); + }); + + describe('Check that the rule does not exist when the shop is in french', function () { + language.selectLanguageFO(2 , " french"); + checkRule.verifRule("" , ' "Printed Dress" product in the category "Casual Dresses"'); + checkRule.selectSleevesTshirtProduct(); + checkRule.verifRule("" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + }); + }); + }); + + describe('Test case n°3 : Add and check english rule in a specific category', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + + after(common.after); + + describe('Add english rule in a specific category', function() { + authentication.loginBO(); + module.searchModule("seoimage"); + describe('Configure the SEO Image module', function () { + module.configureModule(); + rule.addRule('testEN2'); + language.selectRuleLanguage(1 , " english"); + rule.clickNextButton(); + rule.selectEveningDressesCategory(); + rule.clickNextButton(); + rule.ruleCondition('{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} EN2',' "{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} EN2"'); + rule.saveForm(); + rule.closeGreenValidation(); + rule.applyRule(2); + }); + + authentication.logoutBO(); + }); + + describe('Check english rule in a specific category in FO', function() { + authentication.openShop(); + describe('Check that the rule exists when the shop is in english', function () { + language.selectLanguageFO(1 , " english"); + checkRule.selectPrintedDressEveningDressesCategory(); + checkRule.verifRule("€50.99€50.99 EN2" , ' "Printed Dress" product in the category "Evening Dresses"'); + checkRule.selectPrintedDressCasualDressesCategory(); + checkRule.verifRule("Casual Dresses EN1" , ' "Printed Dress" product in the category "Casual Dresses"'); + + }); + + describe('Check that the rule does not exist when the shop is in french', function () { + language.selectLanguageFO(2 , " french") + checkRule.verifRule("" , ' "Printed Dress" product in the category "Casual Dresses"'); + checkRule.selectPrintedDressEveningDressesCategory(); + checkRule.verifRule("" , ' "Printed Dress" product in the category "Casual Dresses"'); + }); + }); + }); + + describe('Test case n°4 : Apply all rules', function(){ + common.initMocha.call(this); + + before(function(done){ + this.selector = globals.selector; + this.client.call(done); + }); + + after(common.after); + + describe('Add french rule in all categories', function() { + authentication.loginBO(); + module.searchModule("seoimage"); + describe('Configure the SEO Image module', function() { + module.configureModule(); + rule.addRule('testFR1'); + language.selectRuleLanguage(2 , " french"); + rule.clickNextButton(); + rule.allCategory(); + rule.clickNextButton(); + rule.ruleCondition('{product_name}{product_reference} FR1',' "{product_name}{product_reference} FR1"'); + rule.saveForm(); + rule.closeGreenValidation(); + }); + }); + + describe('Add french rule in a specific category', function() { + describe('Configure the SEO Image module', function () { + rule.addRule('testFR2'); + language.selectRuleLanguage(2 , " french"); + rule.clickNextButton(); + rule.selectEveningDressesCategory(); + rule.clickNextButton(); + rule.ruleCondition('{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} FR2',' "{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} FR2"'); + rule.saveForm(); + rule.closeGreenValidation(); + it('should click on apply all rules button ', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .waitForExist(this.selector.BO.ModuleConfiguration.apply_all_rules_button, 90000) + .click(this.selector.BO.ModuleConfiguration.apply_all_rules_button) + .pause(5000) + .call(done); + }); + }); + authentication.logoutBO(); + }); + + describe('Check all rules in FO', function() { + authentication.openShop(); + describe('Check that the rule exists when the shop is in english', function () { + language.selectLanguageFO(1 , " english") + checkRule.selectPrintedDressEveningDressesCategory(); + checkRule.verifRule("€50.99€50.99 EN2" , ' "Printed Dress" product in the category Evening "Dresses"'); + checkRule.selectSleevesTshirtProduct(); + checkRule.verifRule("T-shirts EN1" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + }); + + describe('Check that the rule exists when the shop is in french', function () { + language.selectLanguageFO(2 ," french") + checkRule.verifRule("T-shirt délavé à manches courtesdemo_1 FR1" , ' "Faded Short Sleeves T-Shirt" product in the category "Tops"'); + checkRule.selectPrintedDressEveningDressesCategory(); + checkRule.verifRule("€50.99€50.99 FR2" , ' "Printed Dress" product in the category "Casual Dresses"'); + + }); + + + }); + }); + +}); \ No newline at end of file diff --git a/SEOImage_module/test/common.webdriverio.js b/SEOImage_module/test/common.webdriverio.js index 48cf175..1dcdbf5 100644 --- a/SEOImage_module/test/common.webdriverio.js +++ b/SEOImage_module/test/common.webdriverio.js @@ -39,10 +39,10 @@ function initCommands(client) { this.selector = globals.selector; client .url('http://' + URL + '/admin-dev/') - .waitForExist(this.selector.BO.LoginPage.login, 90000) - .setValue(this.selector.BO.LoginPage.login, 'demo@prestashop.com') - .setValue(this.selector.BO.LoginPage.password, 'prestashop_demo') - .click(this.selector.BO.LoginPage.login_btn) + .waitForExist(this.selector.BO.LoginPage.login_input, 90000) + .setValue(this.selector.BO.LoginPage.login_input, 'demo@prestashop.com') + .setValue(this.selector.BO.LoginPage.password_input, 'prestashop_demo') + .click(this.selector.BO.LoginPage.login_button) .waitForExist(this.selector.BO.Common.menu, 90000) .call(cb); }); @@ -51,12 +51,13 @@ function initCommands(client) { this.selector = globals.selector; client .url('http://' + URL) - .waitForExist(this.selector.FO.HomePage.access_loginFO, 90000) - .click(this.selector.FO.HomePage.access_loginFO) - .waitForExist(this.selector.FO.HomePage.loginFO, 90000) - .setValue(this.selector.FO.HomePage.loginFO, 'pub@prestashop.com') - .setValue(this.selector.FO.HomePage.passwordFO, '123456789') - .click(this.selector.FO.HomePage.login_btnFO) + .waitForExist(this.selector.FO.HomePage.access_login_button, 90000) + .click(this.selector.FO.HomePage.access_login_button) + .waitForExist(this.selector.FO.HomePage.login_input, 90000) + .setValue(this.selector.FO.HomePage.login_input, 'pub@prestashop.com') + .setValue(this.selector.FO.HomePage.password_input, '123456789') + .click(this.selector.FO.HomePage.login_button) + .waitForExist(this.selector.FO.HomePage.logo_home_page) .call(cb); }); @@ -81,30 +82,6 @@ function initCommands(client) { .call(cb); }); - client.addCommand('changeENlanguageFO', function (cb) { - this.selector = globals.selector; - client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .waitForExist(this.selector.FO.Common.english_btn, 90000) - .click(this.selector.FO.Common.english_btn) - .call(cb); - }); - - client.addCommand('changeFRlanguageFO', function (cb) { - this.selector = globals.selector; - client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .click(this.selector.FO.Common.french_btn) - .pause(3000) - .call(cb); - }); - client.addCommand('getProductname', function (cb) { this.selector = globals.selector; client @@ -156,9 +133,9 @@ module.exports = { after: function (done) { done(); }, - take_screenshot: function (done) { + /*take_screenshot: function (done) { client.saveScreenshot(__dirname +'/screenshots/' + client.desiredCapabilities.browserName + '-Exception' + '_' + global.fctname + '.png'); - }, + },*/ initMocha: function () { this.timeout(900000000); this.slow(45000); diff --git a/SEOImage_module/test/globals.webdriverio.js b/SEOImage_module/test/globals.webdriverio.js index 3e95e64..300f611 100644 --- a/SEOImage_module/test/globals.webdriverio.js +++ b/SEOImage_module/test/globals.webdriverio.js @@ -19,9 +19,9 @@ module.exports = { BO: { //Back office login page selectors LoginPage: { - login: '#email', - password: '#passwd', - login_btn: '[name="submitLogin"]', + login_input: '#email', + password_input: '#passwd', + login_button: '[name="submitLogin"]', }, //Common selectors @@ -31,69 +31,54 @@ module.exports = { //Module page selectors ModulePage: { - modules_menu: '#subtab-AdminParentModulesSf', - installed_moule_page: '//*[@id="main-div"]/div[1]/div[2]/a[2]', - modules_page_loaded: '.module-search-result-wording', - modules_search: '.pstaggerAddTagInput.module-tags-input', + modules_subtub: '#subtab-AdminParentModulesSf', + installed_moule_tabs: '(//div[@class="page-head-tabs"]/a)[2]', + modules_search_results: '.module-search-result-wording', + modules_search_input: '.pstaggerAddTagInput.module-tags-input', modules_search_button: '//*[@id="main-div"]/div[3]/div[2]/div/div[2]/div/div[5]/div/div[1]/div/button', - module_configuration_btn: '//*[@id="modules-list-container-all"]/div[1]/div/div/div[5]/div[2]/form/button', - nbr_module: '//*[@id="main-div"]/div[3]/div[2]/div/div[2]/div/div[7]/span[1]', + module_configuration_button: '//*[@id="modules-list-container-all"]/div[1]/div/div/div[5]/div[2]/form/button', + module_number_span: '//*[@id="main-div"]/div[3]/div[2]/div/div[2]/div/div[7]/span[1]', }, //Module page configuration selectors ModuleConfiguration: { - seo_config_panel: '//*[@id="modulecontent"]/div[1]/div[1]/a[2]', - add_rules_btn: '.process-icon-new', - rule_name: '//*[@id="rule_name"]', - rule_lang_btn: '//*[@id="step-1"]/div[3]/div/div[1]/button', - rule_english_lang: '//*[@id="step-1"]/div[3]/div/div[1]/div/ul/li[1]', - rule_french_lang: '//*[@id="step-1"]/div[3]/div/div[1]/div/ul/li[2]', - next_step_rules: '//*[@id="next-step"]', - all_catalog_btn_rules: '//*[@id="radios-0"]/label/input', - rules_condition: '//*[@id="legend"]', - save_rules: '//*[@id="btn-save"]', - close_green_validation: '/html/body/div[6]/div/div/div[1]/div/div[2]/button', - apply_rule1_btn: '//*[@id="table-metas-1"]/tbody/tr/td[7]/div/div/a', - apply_rule2_btn: '//*[@id="table-metas-1"]/tbody/tr[2]/td[7]/div/div/a', - apply_rule3_btn: '//*[@id="table-metas-1"]/tbody/tr[3]/td[7]/div/div/a', - apply_rule4_btn: '//*[@id="table-metas-1"]/tbody/tr[4]/td[7]/div/div/a', - apply_all_rules: '//*[@id="table-metas-1"]/a[1]', - dropdownlist_btn: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/button', - edit_rule_btn: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/ul/li[1]/a', - expan_all_btn: '//*[@id="expandall"]', - evening_dress_checkbox: '//*[@id="category_10"]/a/i[1]', + optimize_images_tab: '//*[@id="modulecontent"]/div[1]/div[1]/a[2]', + add_new_rule_button: '.process-icon-new', + rule_name_input: '//*[@id="rule_name"]', + ruleLanguage_dropdownlist: '//*[@id="step-1"]/div[3]/div/div[1]/button', + ruleLanguage_select: '//*[@id="step-1"]/div[3]/div/div[1]/div/ul/li[%s]', + next_step_rule_button: '//*[@id="next-step"]', + all_category_radio_button: '//*[@id="radios-0"]/label/input', + legend_input: '//*[@id="legend"]', + save_rule_button: '//*[@id="btn-save"]', + green_validation_notice: '/html/body/div[6]/div/div/div[1]/div/div[2]/button', + apply_rule_button: '//*[@id="table-metas-1"]/tbody/tr[%s]/td[7]/div/div/a', + apply_second_rule_button: '//*[@id="table-metas-1"]/tbody/tr[2]/td[7]/div/div/a', + apply_all_rules_button: '//*[@id="table-metas-1"]/a[1]', + dropdown_button: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/button', + edit_rule_button: '//*[@id="table-metas-1"]/tbody/tr[1]/td[7]/div/div/ul/li[1]/a', + expan_all_button: '//*[@id="expandall"]', + evening_dresses_checkbox: '//*[@id="category_10"]/a/i[1]', }, }, FO : { //Common selectors Common: { - lang_btn: '//*[@id="_desktop_language_selector"]/div/div/button', - english_btn: '//*[@id="_desktop_language_selector"]/div/div/ul/li[1]/a', - french_btn: '//*[@id="_desktop_language_selector"]/div/div/ul/li[2]/a', + language_button: '//*[@id="_desktop_language_selector"]/div/div/button', + chooseLanguage_button: '//*[@id="_desktop_language_selector"]/div/div/ul/li[%s]/a', }, //Home page selectors HomePage: { - access_loginFO: 'div.user-info > a', - loginFO: '//*[@id="login-form"]/section/div[1]/div[1]/input', - passwordFO: '//*[@id="login-form"]/section/div[2]/div[1]/div/input', - login_btnFO: '//*[@id="login-form"]/footer/button', - logoutFO: '.logout', - logo_home_pageFO: '.logo.img-responsive', - all_product: '//*[@id="content"]/section/a', - }, - - //Category page selectors - CategoryPage: { - first_product: '//*[@id="js-product-list"]/div[1]/article[1]/div/a/img', - category_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li/div[1]', - category_women_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li/div[1]/i[1]', - tops_category: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[1]/a', - dresses_category: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[2]/a', - dresses_category_list: '//*[@id="exCollapsingNavbar3"]/ul/li[2]/span/i[1]', - evening_dresses_category: '//*[@id="exCollapsingNavbar8"]/ul/li[2]/a', - casual_dresses_category: '//*[@id="exCollapsingNavbar8"]/ul/li[1]/a', - dresses_list: '//*[@id="left-column"]/div[1]/ul/li[2]/ul/li[2]/div[1]/i[1]', + access_login_button: 'div.user-info > a', + login_input: '//*[@id="login-form"]/section/div[1]/div[1]/input', + password_input: '//*[@id="login-form"]/section/div[2]/div[1]/div/input', + login_button: '//*[@id="login-form"]/footer/button', + logout_button: '.logout', + logo_home_page: '//*[@id="_desktop_logo"]/a/img', + sleeves_tshirt_image: '//*[@id="content"]/section/div/article[1]/div/a/img', + printed_dress_casual_dresses_category_image: '//*[@id="content"]/section/div/article[3]/div/a/img', + printed_dress_evening_dresses_category_image: '//*[@id="content"]/section/div/article[4]/div/a/img', }, //Product page selectors @@ -103,7 +88,7 @@ module.exports = { product_image: '//*[@id="product-modal"]/div/div/div/figure/img', thumbnail_image: '//*[@id="content"]/div[1]/div[2]/ul/li[1]/img', category_name: '//*[@id="wrapper"]/div/nav/ol/li[4]/a/span', - women_category: '//*[@id="wrapper"]/div/nav/ol/li[2]/a', + women_category_select: '//*[@id="wrapper"]/div/nav/ol/li[2]/a', }, } diff --git a/SEOImage_module/test/index.webdriverio.js b/SEOImage_module/test/index.webdriverio.js deleted file mode 100644 index af855fd..0000000 --- a/SEOImage_module/test/index.webdriverio.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('./common.webdriverio'); - - -describe('Allscenario', function(){ - common.initMocha.call(this); - - before(function (done) { - this.client = common.getClient(); - this.client.call(done); - }); - - after(function (done) { - this.client - .end() - .call(done); - }); - - // Add EN rule in all categories in BO and check it in FO - require('./scenario/BO/add_EN_rule_all_categories.webdriverio'); - require('./scenario/FO/check_EN_rule_all_categories.webdriverio'); - - // Edit EN rule in all categories in BO and check it in FO - require('./scenario/BO/edit_EN_rule_all_categories.webdriverio'); - require('./scenario/FO/check_edited_EN_rule_all_categories.webdriverio'); - - // Add EN rule in a specific category in BO and check it in FO - require('./scenario/BO/add_EN_rule_specific_category.webdriverio'); - require('./scenario/FO/check_EN_rule_specific_category.webdriverio'); - - // Add FR rule in all categories and in specific category - require('./scenario/BO/add_FR_rule_all_categories.webdriverio'); - require('./scenario/BO/add_FR_rule_specific_category.webdriverio'); - - //Check all rules in FO - require('./scenario/FO/check_all_rules.webdriverio') - - -}); diff --git a/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js deleted file mode 100644 index 153c80c..0000000 --- a/SEOImage_module/test/scenario/BO/add_EN_rule_all_categories.webdriverio.js +++ /dev/null @@ -1,161 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Add rule in all categories when the front is in english ', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - describe('Log in in Back Office', function(done){ - it('should log in successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signinBO() - .waitForExist(this.selector.BO.Common.menu, 90000) - .call(done); - }); - }); - - describe('Go to the module configuration page', function(done) { - it('should go to the modules page', function (done) { - global.fctname = this.test.title; - this.client - .pause(5000) - .click(this.selector.BO.ModulePage.modules_menu) - .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) - .call(done); - }); - - it('should go to the module', function (done) { - global.fctname = this.test.title; - - this.client - .click(this.selector.BO.ModulePage.installed_moule_page) - .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) - .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") - .click(this.selector.BO.ModulePage.modules_search_button) - .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { - global.nbr = parseInt(text[0]); - if (global.nbr == 0) { - done(new Error('The module you are searching for does not exist!')); - } - else - done(); - }) - }); - }); - - describe('The configuration of the module', function(done) { - it('should go to the module configuration page ', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) - .click(this.selector.BO.ModulePage.module_configuration_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) - .click(this.selector.BO.ModuleConfiguration.seo_config_panel) - .call(done); - }); - - it('should click on add new rule', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.add_rules_btn) - .call(done); - }); - - it('should add the rule name', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) - .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testEN1') - .call(done); - }); - - it('should choose the english language', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.rule_english_lang, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_english_lang) - .call(done); - }); - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done); - }); - - it('should selelct all catlgories', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .waitForExist(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules) - .call(done) - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done) - }); - - it('should write the rule condition', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) - .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) - .pause(5000) - .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_name}{product_reduce_price} EN1') - .call(done); - }); - it('should save the form', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.save_rules) - .call(done); - }); - - it('should close the green validatlon ', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .click(this.selector.BO.ModuleConfiguration.close_green_validation) - .call(done); - }); - - it('should click on apply rule ', function(done){ - global.fctname= this.test.title; - this.client - .pause(5000) - .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule1_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.apply_rule1_btn) - .pause(5000) - .call(done); - }); - }); - - describe('Log out in Back Office', function(done){ - it('should log out successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signoutBO() - .call(done); - }); - }); -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js deleted file mode 100644 index 733d72e..0000000 --- a/SEOImage_module/test/scenario/BO/add_EN_rule_specific_category.webdriverio.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Add rule in a specific category when the front is in english ', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - describe('Log in in Back Office', function(done){ - it('should log in successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signinBO() - .waitForExist(this.selector.BO.Common.menu, 90000) - .call(done); - }); - }); - - describe('Go to the module configuration page', function(done) { - it('should go to the modules page', function (done) { - global.fctname = this.test.title; - this.client - .pause(5000) - .click(this.selector.BO.ModulePage.modules_menu) - .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) - .call(done); - }); - - it('should go to the module', function (done) { - global.fctname = this.test.title; - - this.client - .click(this.selector.BO.ModulePage.installed_moule_page) - .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) - .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") - .click(this.selector.BO.ModulePage.modules_search_button) - .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { - global.nbr = parseInt(text[0]); - if (global.nbr == 0) { - done(new Error('The module you are searching for does not exist!')); - } - else - done(); - }) - }); - }); - - describe('The configuration of the module', function(done) { - it('should go to the module configuration page ', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) - .click(this.selector.BO.ModulePage.module_configuration_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) - .click(this.selector.BO.ModuleConfiguration.seo_config_panel) - .call(done); - }); - - it('should click on add new rule', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.add_rules_btn) - .call(done); - }); - - it('should add the rule name', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) - .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testEN2') - .call(done); - }); - - it('should choose the english language', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.rule_english_lang, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_english_lang) - .call(done); - }); - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done); - }); - - it('should select Evening dresses category', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .waitForExist(this.selector.BO.ModuleConfiguration.expan_all_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.expan_all_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.evening_dress_checkbox, 90000) - .click(this.selector.BO.ModuleConfiguration.evening_dress_checkbox) - .call(done) - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done) - }); - - it('should write the rule condition', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) - .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) - .pause(5000) - .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} EN2') - .call(done); - }); - it('should save the form', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.save_rules) - .call(done); - }); - - it('should close the green validation ', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .click(this.selector.BO.ModuleConfiguration.close_green_validation) - .call(done); - }); - - it('should click on apply all rules ', function(done){ - global.fctname= this.test.title; - this.client - .pause(5000) - .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule2_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.apply_rule2_btn) - .pause(5000) - .call(done); - }); - }); - - describe('Log out in Back Office', function(done){ - it('should log out successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signoutBO() - .call(done); - }); - }); -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js deleted file mode 100644 index eb08094..0000000 --- a/SEOImage_module/test/scenario/BO/add_FR_rule_all_categories.webdriverio.js +++ /dev/null @@ -1,143 +0,0 @@ - -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Add rule in all categories when the front is in french ', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - describe('Log in in Back Office', function(done){ - it('should log in successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signinBO() - .waitForExist(this.selector.BO.Common.menu, 90000) - .call(done); - }); - }); - - describe('Go to the module configuration page', function(done) { - it('should go to the modules page', function (done) { - global.fctname = this.test.title; - this.client - .pause(5000) - .click(this.selector.BO.ModulePage.modules_menu) - .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) - .call(done); - }); - - it('should go to the module', function (done) { - global.fctname = this.test.title; - - this.client - .click(this.selector.BO.ModulePage.installed_moule_page) - .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) - .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") - .click(this.selector.BO.ModulePage.modules_search_button) - .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { - global.nbr = parseInt(text[0]); - if (global.nbr == 0) { - done(new Error('The module you are searching for does not exist!')); - } - else - done(); - }) - }); - }); - - describe('The configuration of the module', function(done) { - it('should go to the module configuration page ', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) - .click(this.selector.BO.ModulePage.module_configuration_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) - .click(this.selector.BO.ModuleConfiguration.seo_config_panel) - .call(done); - }); - - it('should click on add new rule', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.add_rules_btn) - .call(done); - }); - - it('should add the rule name', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) - .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testFR1') - .call(done); - }); - - it('should choose the french language', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.rule_french_lang, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_french_lang) - .call(done); - }); - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done); - }); - - it('should selelct all catlgories', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .waitForExist(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.all_catalog_btn_rules) - .call(done) - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done) - }); - - it('should write the rule condition', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) - .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) - .pause(5000) - .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_name}{product_reference} FR1') - .call(done); - }); - it('should save the form', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.save_rules) - .call(done); - }); - - it('should close the green validation ', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .click(this.selector.BO.ModuleConfiguration.close_green_validation) - .call(done); - }); - }); -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js deleted file mode 100644 index 922a399..0000000 --- a/SEOImage_module/test/scenario/BO/add_FR_rule_specific_category.webdriverio.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Add rule in a specific category when the front is in french ', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - describe('The add of the french rule', function(done) { - it('should click on add new rule', function(done) { - global.fctname = this.test.title; - this.client - .pause(5000) - .waitForExist(this.selector.BO.ModuleConfiguration.add_rules_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.add_rules_btn) - .call(done); - }); - - it('should add the rule name', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_name, 60000) - .setValue(this.selector.BO.ModuleConfiguration.rule_name, 'testFR2') - .call(done); - }); - - it('should choose the french language', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rule_lang_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_lang_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.rule_french_lang, 90000) - .click(this.selector.BO.ModuleConfiguration.rule_french_lang) - .call(done); - }); - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done); - }); - - it('should select Evening dresses category', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .waitForExist(this.selector.BO.ModuleConfiguration.expan_all_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.expan_all_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.evening_dress_checkbox, 90000) - .click(this.selector.BO.ModuleConfiguration.evening_dress_checkbox) - .call(done) - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done) - }); - - it('should write the rule condition', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) - .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) - .pause(5000) - .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{product_price_wt}{product_reduce_price_wt}{product_reduction_percent} FR2') - .call(done); - }); - it('should save the form', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.save_rules) - .call(done); - }); - - it('should close the green validation ', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .click(this.selector.BO.ModuleConfiguration.close_green_validation) - .call(done); - }); - - it('should click on apply all rules ', function(done){ - global.fctname= this.test.title; - this.client - .pause(5000) - .waitForExist(this.selector.BO.ModuleConfiguration.apply_all_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.apply_all_rules) - .pause(5000) - .call(done); - }); - }); - - describe('Log out in Back Office', function(done){ - it('should log out successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signoutBO() - .call(done); - }); - }); -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js deleted file mode 100644 index d2c5998..0000000 --- a/SEOImage_module/test/scenario/BO/edit_EN_rule_all_categories.webdriverio.js +++ /dev/null @@ -1,137 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Edit the english rule in all categories ', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - describe('Log in in Back Office', function(done){ - it('should log in successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signinBO() - .waitForExist(this.selector.BO.Common.menu, 90000) - .call(done); - }); - }); - - describe('Go to the module configuration page', function(done) { - it('should go to the modules page', function (done) { - global.fctname = this.test.title; - this.client - .pause(5000) - .click(this.selector.BO.ModulePage.modules_menu) - .waitForExist(this.selector.BO.ModulePage.modules_page_loaded, 90000) - .call(done); - }); - - it('should go to the module', function (done) { - global.fctname = this.test.title; - - this.client - .click(this.selector.BO.ModulePage.installed_moule_page) - .waitForExist(this.selector.BO.ModulePage.modules_search, 90000) - .setValue(this.selector.BO.ModulePage.modules_search, "seoimg") - .click(this.selector.BO.ModulePage.modules_search_button) - .getText(this.selector.BO.ModulePage.nbr_module).then(function (text) { - global.nbr = parseInt(text[0]); - if (global.nbr == 0) { - done(new Error('The module you are searching for does not exist!')); - } - else - done(); - }) - }); - }); - - describe('The configuration of the module', function(done) { - it('should go to the module configuration page ', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModulePage.module_configuration_btn, 90000) - .click(this.selector.BO.ModulePage.module_configuration_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.seo_config_panel, 90000) - .click(this.selector.BO.ModuleConfiguration.seo_config_panel) - .call(done); - }); - - it('should click on edit rule', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.dropdownlist_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.dropdownlist_btn) - .waitForExist(this.selector.BO.ModuleConfiguration.edit_rule_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.edit_rule_btn) - .call(done); - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done); - }); - - it('should click on next button', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.next_step_rules) - .call(done) - }); - - it('should edit the rule condition', function(done){ - global.fctname= this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.rules_condition, 90000) - .leftClick(this.selector.BO.ModuleConfiguration.rules_condition) - .pause(5000) - .setValue(this.selector.BO.ModuleConfiguration.rules_condition,'{default_cat_name} EN1') - .call(done); - }); - it('should save the form', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.BO.ModuleConfiguration.save_rules, 90000) - .click(this.selector.BO.ModuleConfiguration.save_rules) - .call(done); - }); - - it('should close the green validatlon ', function(done){ - global.fctname= this.test.title; - this.client - .pause(2000) - .click(this.selector.BO.ModuleConfiguration.close_green_validation) - .call(done); - }); - - it('should click on apply rule ', function(done){ - global.fctname= this.test.title; - this.client - .pause(5000) - .waitForExist(this.selector.BO.ModuleConfiguration.apply_rule1_btn, 90000) - .click(this.selector.BO.ModuleConfiguration.apply_rule1_btn) - .pause(5000) - .call(done); - }); - }); - - describe('Log out in Back Office', function(done){ - it('should log out successfully in BO', function(done){ - global.fctname= this.test.title; - this.client - .signoutBO() - .call(done); - }); - }); -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js deleted file mode 100644 index 5dc88c8..0000000 --- a/SEOImage_module/test/scenario/FO/check_EN_rule_all_categories.webdriverio.js +++ /dev/null @@ -1,204 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Verify the rule applied to all categories when the shop is in english', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - it('should open the shop and loggin FO', function(done) { - global.fctname = this.test.title; - this.client - .signinFO() - .call(done); - }); - - describe('Verify the rule in all categories when the shop is in english', function(done){ - it('should change the shop language to english', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .waitForExist(this.selector.FO.Common.english_btn, 90000) - .click(this.selector.FO.Common.english_btn) - .call(done); - }); - - it('should go to all product page', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) - .click(this.selector.FO.HomePage.logo_home_pageFO) - .scroll(0, 400) - .pause(5000) - .waitForExist(this.selector.FO.HomePage.all_product, 90000) - .click(this.selector.FO.HomePage.all_product) - .call(done); - }); - - it('should select the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.category_list, 90000) - .click(this.selector.FO.CategoryPage.category_list) - .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) - .click(this.selector.FO.CategoryPage.tops_category) - .call(done); - }); - - it('should select the first product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductname() - .getProductprice() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); - }) - .call(done); - }); - - it('should select the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) - .click(this.selector.FO.CategoryPage.dresses_category) - .call(done); - }); - - it('should select the first product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductname() - .getProductprice() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + global.prod_price + " en1"); - }) - .call(done); - }); - }); - - describe('Verify the rule in all categories when the shop is in french', function(done){ - it('should change the shop language to french', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .click(this.selector.FO.Common.french_btn) - .pause(3000) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should select the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) - .click(this.selector.FO.CategoryPage.dresses_category) - .call(done); - }); - - it('should select the first product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - }); - - - describe('Log out in Front Office', function(done){ - it('should logout successfully in FO', function(done){ - global.fctname= this.test.title; - this.client - .signoutFO() - .call(done); - }); - }); - -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js b/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js deleted file mode 100644 index ccf61bb..0000000 --- a/SEOImage_module/test/scenario/FO/check_EN_rule_specific_category.webdriverio.js +++ /dev/null @@ -1,171 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Verify the rule applied to a specific category when the shop is in english', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - it('should open the shop and loggin FO', function(done) { - global.fctname = this.test.title; - this.client - .signinFO() - .call(done); - }); - - describe('Verify the rule in a specific category when the shop is in english', function(done){ - it('should change the shop language to english', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .waitForExist(this.selector.FO.Common.english_btn, 90000) - .click(this.selector.FO.Common.english_btn) - .call(done); - }); - - it('should go to all product page', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) - .click(this.selector.FO.HomePage.logo_home_pageFO) - .scroll(0, 400) - .pause(5000) - .waitForExist(this.selector.FO.HomePage.all_product, 90000) - .click(this.selector.FO.HomePage.all_product) - .call(done); - }); - - it('should select the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.category_women_list, 90000) - .click(this.selector.FO.CategoryPage.category_women_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.dresses_category_list, 90000) - .click(this.selector.FO.CategoryPage.dresses_category_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) - .click(this.selector.FO.CategoryPage.evening_dresses_category) - .call(done); - }); - - it('should select a product in the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal("€50.99€50.99 EN2"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Evening Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal("€50.99€50.99 EN2"); - }) - .call(done); - }); - - it('should select the category Casual Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.dresses_list, 90000) - .click(this.selector.FO.CategoryPage.dresses_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.casual_dresses_category, 90000) - .click(this.selector.FO.CategoryPage.casual_dresses_category) - .call(done); - }); - - it('should select a product in the category Casual Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Casual Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal("Casual Dresses EN1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Casual Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal("Casual Dresses EN1"); - }) - .call(done); - }); - }); - - describe('Verify the rule in a specific category when the shop is in french', function(done){ - it('should change the shop language to french', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .click(this.selector.FO.Common.french_btn) - .pause(3000) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Evening Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - }); - - describe('Log out in Front Office', function(done){ - it('should logout successfully in FO', function(done){ - global.fctname= this.test.title; - this.client - .signoutFO() - .call(done); - }); - }); - -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js b/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js deleted file mode 100644 index 6024c1b..0000000 --- a/SEOImage_module/test/scenario/FO/check_all_rules.webdriverio.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Verify all rules applied when the shop is in english', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - it('should open the shop and loggin FO', function(done) { - global.fctname = this.test.title; - this.client - .signinFO() - .call(done); - }); - - describe('Verify the rule when the shop is in english', function(done){ - it('should change the shop language to english', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .waitForExist(this.selector.FO.Common.english_btn, 90000) - .click(this.selector.FO.Common.english_btn) - .call(done); - }); - - it('should go to all product page', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) - .click(this.selector.FO.HomePage.logo_home_pageFO) - .scroll(0, 400) - .pause(5000) - .waitForExist(this.selector.FO.HomePage.all_product, 90000) - .click(this.selector.FO.HomePage.all_product) - .call(done); - }); - - it('should select the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.category_women_list, 90000) - .click(this.selector.FO.CategoryPage.category_women_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.dresses_category_list, 90000) - .click(this.selector.FO.CategoryPage.dresses_category_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) - .click(this.selector.FO.CategoryPage.evening_dresses_category) - .call(done); - }); - - it('should select the product with the reference demo_4 in the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .call(done); - }); - - it('should verify the rule in the cover image of the product Printed Dress', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal("€50.99€50.99 EN2"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product Printed Dress ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal("€50.99€50.99 EN2"); - }) - .call(done); - }); - - it('should select the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) - .click(this.selector.FO.CategoryPage.tops_category) - .call(done); - }); - - it('should select the first product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductcategory() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - }); - - describe('Verify the rule in all categories when the shop is in french', function(done){ - it('should change the shop language to french', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .click(this.selector.FO.Common.french_btn) - .pause(3000) - .call(done); - }); - - it('should select the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.dresses_list, 90000) - .click(this.selector.FO.CategoryPage.dresses_list) - .pause(3000) - .waitForExist(this.selector.FO.CategoryPage.evening_dresses_category, 90000) - .click(this.selector.FO.CategoryPage.evening_dresses_category) - .call(done); - }); - - it('should select the product with the reference demo_4 in the category Evening Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductname() - .call(done); - }); - - it('should verify the rule in the cover image of the product Printed Dress', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + "demo_4 fr1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product Printed Dress', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + "demo_4 fr1"); - }) - .call(done); - }); - - it('should select the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) - .click(this.selector.FO.CategoryPage.tops_category) - .call(done); - }); - - it('should select the first product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductname() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + "demo_1 fr1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.prod_name + "demo_1 fr1"); - }) - .call(done); - }); - }); - - describe('Log out in Front Office', function(done){ - it('should logout successfully in FO', function(done){ - global.fctname= this.test.title; - this.client - .signoutFO() - .call(done); - }); - }); - -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js b/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js deleted file mode 100644 index 22478f0..0000000 --- a/SEOImage_module/test/scenario/FO/check_edited_EN_rule_all_categories.webdriverio.js +++ /dev/null @@ -1,202 +0,0 @@ -'use strict'; -var should = require('should'); -var common = require('../../common.webdriverio'); -var globals = require('../../globals.webdriverio.js'); - -describe('Verify the edited rule applied to all categories when the shop is in english', function(){ - common.initMocha.call(this); - - before(function(done){ - this.selector = globals.selector; - this.client.call(done); - }); - process.on('uncaughtException', common.take_screenshot); - process.on('ReferenceError', common.take_screenshot); - after(common.after); - - it('should open the shop and loggin FO', function(done) { - global.fctname = this.test.title; - this.client - .signinFO() - .call(done); - }); - - describe('Verify the edited rule in all categories when the shop is in english', function(done){ - it('should change the shop language to english', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .waitForExist(this.selector.FO.Common.english_btn, 90000) - .click(this.selector.FO.Common.english_btn) - .call(done); - }); - - it('should go to all product page', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.HomePage.logo_home_pageFO, 90000) - .click(this.selector.FO.HomePage.logo_home_pageFO) - .scroll(0, 400) - .pause(5000) - .waitForExist(this.selector.FO.HomePage.all_product, 90000) - .click(this.selector.FO.HomePage.all_product) - .call(done); - }); - - it('should select the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.category_list, 90000) - .click(this.selector.FO.CategoryPage.category_list) - .waitForExist(this.selector.FO.CategoryPage.tops_category, 90000) - .click(this.selector.FO.CategoryPage.tops_category) - .call(done); - }); - - it('should select the first product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductcategory() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "title").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - - it('should select the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) - .click(this.selector.FO.CategoryPage.dresses_category) - .call(done); - }); - - it('should select the first product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .getProductcategory() - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text.toLowerCase()).be.equal(global.categ_name + " en1"); - }) - .call(done); - }); - }); - - describe('Verify the rule in all categories when the shop is in french', function(done){ - it('should change the shop language to french', function(done){ - global.fctname= this.test.title; - this.client - .pause(6000) - .waitForExist(this.selector.FO.Common.lang_btn, 90000) - .click(this.selector.FO.Common.lang_btn) - .pause(3000) - .click(this.selector.FO.Common.french_btn) - .pause(3000) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Tops', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Tops ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should select the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.ProductPage.women_category, 90000) - .click(this.selector.FO.ProductPage.women_category) - .waitForExist(this.selector.FO.CategoryPage.dresses_category, 90000) - .click(this.selector.FO.CategoryPage.dresses_category) - .call(done); - }); - - it('should select the first product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .waitForExist(this.selector.FO.CategoryPage.first_product, 90000) - .click(this.selector.FO.CategoryPage.first_product) - .call(done); - }); - - it('should verify the rule in the cover image of the product in the category Dresses', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - - it('should verify the rule in the thumbnail image of the product in the category Dresses ', function(done) { - global.fctname = this.test.title; - this.client - .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function(text) { - should(text).be.equal(""); - }) - .call(done); - }); - }); - - - describe('Log out in Front Office', function(done){ - it('should logout successfully in FO', function(done){ - global.fctname= this.test.title; - this.client - .signoutFO() - .call(done); - }); - }); - -}); \ No newline at end of file diff --git a/SEOImage_module/test/scenario/actionbloc/action-module.webdriverio.js b/SEOImage_module/test/scenario/actionbloc/action-module.webdriverio.js new file mode 100644 index 0000000..dbb3e2d --- /dev/null +++ b/SEOImage_module/test/scenario/actionbloc/action-module.webdriverio.js @@ -0,0 +1,48 @@ +module.exports = { + searchModule: function (moduleName) { + describe('Go to the module configuration page', function (done) { + it('should go to the modules page', function (done) { + global.fctname = this.test.title; + this.client + .pause(5000) + .click(this.selector.BO.ModulePage.modules_subtub) + .waitForExist(this.selector.BO.ModulePage.modules_search_results, 90000) + .call(done); + }); + + it('should search the ' + moduleName + ' module', function (done) { + global.fctname = this.test.title; + this.client + .click(this.selector.BO.ModulePage.installed_moule_tabs) + .waitForExist(this.selector.BO.ModulePage.modules_search_input, 90000) + .setValue(this.selector.BO.ModulePage.modules_search_input, moduleName) + .click(this.selector.BO.ModulePage.modules_search_button) + .getText(this.selector.BO.ModulePage.module_number_span).then(function (text) { + global.nbr = parseInt(text[0]); + if (global.nbr == 0) { + done(new Error('The module you are searching for does not exist!')); + } + else + done(); + }) + }); + }); + }, + configureModule: function () { + it('should go to the module configuration page', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModulePage.module_configuration_button, 90000) + .click(this.selector.BO.ModulePage.module_configuration_button) + .call(done); + }); + + it('should go to "Optimize Images" tab', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.optimize_images_tab, 90000) + .click(this.selector.BO.ModuleConfiguration.optimize_images_tab) + .call(done); + }); + } +} diff --git a/SEOImage_module/test/scenario/actionbloc/add-rule.webdriverio.js b/SEOImage_module/test/scenario/actionbloc/add-rule.webdriverio.js new file mode 100644 index 0000000..6467019 --- /dev/null +++ b/SEOImage_module/test/scenario/actionbloc/add-rule.webdriverio.js @@ -0,0 +1,98 @@ +module.exports = { + addRule : function (x) { + it('should click on "add new rule" button', function (done) { + global.fctname = this.test.title; + this.client + .pause(3000) + .waitForVisible(this.selector.BO.ModuleConfiguration.add_new_rule_button, 90000) + .click(this.selector.BO.ModuleConfiguration.add_new_rule_button) + .call(done); + }); + + it('should set the rule name', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.rule_name_input, 60000) + .setValue(this.selector.BO.ModuleConfiguration.rule_name_input, x) + .call(done); + }); + }, + + allCategory : function(){ + it('should select "all category"', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.all_category_radio_button, 90000) + .click(this.selector.BO.ModuleConfiguration.all_category_radio_button) + .call(done) + }); + }, + + clickNextButton : function(){ + it('should click on "next" button', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.next_step_rule_button, 90000) + .click(this.selector.BO.ModuleConfiguration.next_step_rule_button) + .call(done) + }); + }, + + selectEveningDressesCategory : function(){ + it('should select "Evening dresses" category', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.expan_all_button, 90000) + .click(this.selector.BO.ModuleConfiguration.expan_all_button) + .waitForExist(this.selector.BO.ModuleConfiguration.evening_dresses_checkbox, 90000) + .click(this.selector.BO.ModuleConfiguration.evening_dresses_checkbox) + .call(done) + }); + }, + + ruleCondition : function(x , ruleCondition){ + it('should set the rule condition to' + ruleCondition, function(done){ + global.fctname= this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.legend_input, 90000) + .pause(5000) + .setValue(this.selector.BO.ModuleConfiguration.legend_input, x) + .call(done); + }); + }, + + saveForm : function(){ + it('should save the form', function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.save_rule_button, 90000) + .click(this.selector.BO.ModuleConfiguration.save_rule_button) + .call(done); + }); + }, + + applyRule : function(i){ + it('should click on "apply rule" button', function(done){ + global.fctname= this.test.title; + this.client + .pause(6000) + .waitForVisible(this.selector.BO.ModuleConfiguration.apply_rule_button.replace('%s', i), 90000) + .click(this.selector.BO.ModuleConfiguration.apply_rule_button.replace('%s', i)) + .pause(5000) + .call(done); + }); + }, + + closeGreenValidation : function(){ + it('should close the green validatlon', function(done){ + global.fctname= this.test.title; + this.client + .pause(2000) + .waitForExist(this.selector.BO.ModuleConfiguration.green_validation_notice, 90000) + .click(this.selector.BO.ModuleConfiguration.green_validation_notice) + .call(done); + }); + } +} \ No newline at end of file diff --git a/SEOImage_module/test/scenario/actionbloc/authentication.webdriverio.js b/SEOImage_module/test/scenario/actionbloc/authentication.webdriverio.js new file mode 100644 index 0000000..bb983fa --- /dev/null +++ b/SEOImage_module/test/scenario/actionbloc/authentication.webdriverio.js @@ -0,0 +1,48 @@ +module.exports = { + loginBO : function () { + describe('Log in in Back Office', function (done) { + it('should log in successfully in BO', function (done) { + global.fctname = this.test.title; + this.client + .signinBO() + .waitForExist(this.selector.BO.Common.menu, 90000) + .call(done); + }); + }); + }, + + logoutBO : function(){ + describe('Log out from the Back Office', function (done) { + it('should log out successfully in BO', function (done) { + global.fctname = this.test.title; + this.client + .signoutBO() + .call(done); + }); + }); + }, + + loginFO : function() { + describe('Go to the front office', function () { + it('should go to the FO', function (done) { + global.fctname = this.test.title; + this.client + .signinFO() + .call(done); + }); + }); + }, + + openShop : function(){ + describe('Go to the front office', function () { + it('should go to the FO', function (done) { + global.fctname = this.test.title; + this.client + .url('http://' + URL) + .waitForExist(this.selector.FO.HomePage.logo_home_page) + .call(done); + }); + }); + } + +}; diff --git a/SEOImage_module/test/scenario/actionbloc/check-rule.webdriverio.js b/SEOImage_module/test/scenario/actionbloc/check-rule.webdriverio.js new file mode 100644 index 0000000..26684fc --- /dev/null +++ b/SEOImage_module/test/scenario/actionbloc/check-rule.webdriverio.js @@ -0,0 +1,61 @@ +var should = require('should'); + +module.exports = { + verifRule: function (x , y) { + it('should check the rule in the cover image of the' + y, function (done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.product_image, "alt").then(function (text) { + should(text).be.equal(x); + }) + .call(done); + }); + + it('should check the rule in the thumbnail image of the' + y, function (done) { + global.fctname = this.test.title; + this.client + .getAttribute(this.selector.FO.ProductPage.thumbnail_image, "alt").then(function (text) { + should(text).be.equal(x); + }) + .call(done); + }); + }, + + selectSleevesTshirtProduct: function () { + it('should select the "Faded Short Sleeves T-Shirt" product in the category "Tops"', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_page, 90000) + .click(this.selector.FO.HomePage.logo_home_page) + .waitForExist(this.selector.FO.HomePage.sleeves_tshirt_image, 90000) + .click(this.selector.FO.HomePage.sleeves_tshirt_image) + .call(done); + }); + }, + + selectPrintedDressCasualDressesCategory: function () { + it('should select the "Printed Dress" product in the category "Dresses"', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_page, 90000) + .click(this.selector.FO.HomePage.logo_home_page) + .waitForExist(this.selector.FO.HomePage.printed_dress_casual_dresses_category_image, 90000) + .click(this.selector.FO.HomePage.printed_dress_casual_dresses_category_image) + .call(done); + }); + }, + + selectPrintedDressEveningDressesCategory: function () { + it('should select the "Printed Dress" product in the category "Dresses"', function (done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.FO.HomePage.logo_home_page, 90000) + .click(this.selector.FO.HomePage.logo_home_page) + .waitForExist(this.selector.FO.HomePage.printed_dress_evening_dresses_category_image, 90000) + .click(this.selector.FO.HomePage.printed_dress_evening_dresses_category_image) + .call(done); + }); + } + + +} \ No newline at end of file diff --git a/SEOImage_module/test/scenario/actionbloc/set-language.webdriverio.js b/SEOImage_module/test/scenario/actionbloc/set-language.webdriverio.js new file mode 100644 index 0000000..46aacfd --- /dev/null +++ b/SEOImage_module/test/scenario/actionbloc/set-language.webdriverio.js @@ -0,0 +1,27 @@ +module.exports = { + selectRuleLanguage: function (i,language) { + it('should set the rule language to' + language, function(done) { + global.fctname = this.test.title; + this.client + .waitForExist(this.selector.BO.ModuleConfiguration.ruleLanguage_dropdownlist, 90000) + .click(this.selector.BO.ModuleConfiguration.ruleLanguage_dropdownlist) + .waitForExist(this.selector.BO.ModuleConfiguration.ruleLanguage_select.replace('%s', i), 90000) + .click(this.selector.BO.ModuleConfiguration.ruleLanguage_select.replace('%s', i)) + .call(done); + }); + }, + + selectLanguageFO: function (i,language) { + it('should set the shop language to' + language, function (done) { + global.fctname = this.test.title; + this.client + .waitForVisible(this.selector.FO.Common.language_button, 90000) + .click(this.selector.FO.Common.language_button) + .pause(3000) + .waitForExist(this.selector.FO.Common.chooseLanguage_button.replace('%s', i), 90000) + .click(this.selector.FO.Common.chooseLanguage_button.replace('%s', i)) + .pause(5000) + .call(done); + }); + } +}; diff --git a/Upela/test/scenario/BO/check_account_creation.webdriverio.js b/Upela/test/scenario/BO/check_account_creation.webdriverio.js index 9caf6a4..9c38e23 100644 --- a/Upela/test/scenario/BO/check_account_creation.webdriverio.js +++ b/Upela/test/scenario/BO/check_account_creation.webdriverio.js @@ -14,7 +14,7 @@ describe('Test case n°1 = check account creation', function () { after(common.after); describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .signinBO() .waitForExist(this.selector.BO.Common.menu, 90000) diff --git a/Upela/test/scenario/BO/check_login_to_upela_account.webdriverio.js b/Upela/test/scenario/BO/check_login_to_upela_account.webdriverio.js index 1be4f65..05ecd71 100644 --- a/Upela/test/scenario/BO/check_login_to_upela_account.webdriverio.js +++ b/Upela/test/scenario/BO/check_login_to_upela_account.webdriverio.js @@ -14,7 +14,7 @@ describe('Test case n°2 = check upela account connection', function () { after(common.after); describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .url('http://' + URL + '/backoffice/') .waitForExist(this.selector.BO.Common.menu, 90000) diff --git a/Upela/test/scenario/BO/check_shop_creation.webdriverio.js b/Upela/test/scenario/BO/check_shop_creation.webdriverio.js index 87dda73..cfb86df 100644 --- a/Upela/test/scenario/BO/check_shop_creation.webdriverio.js +++ b/Upela/test/scenario/BO/check_shop_creation.webdriverio.js @@ -14,7 +14,7 @@ describe('Test case n°3 = check upela account connection', function () { after(common.after); describe('Log in in Back Office', function (done) { - it('should log in successfully in BO', function (done) { + it('should log in successfully in actionbloc', function (done) { this.client .url('http://' + URL + '/backoffice/') .waitForExist(this.selector.BO.Common.menu, 90000)