Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 1 | const path = require('path'); |
| 2 | const path_join = path.resolve; |
| 3 | const apps_path = path_join(__dirname, '..', '..', '..', '..'); |
| 4 | const frappe_ui_tests_path = path_join(apps_path, 'frappe', 'frappe', 'tests', 'ui'); |
| 5 | |
| 6 | const login = require(frappe_ui_tests_path + "/login.js")['Login']; |
| 7 | const welcome = require(frappe_ui_tests_path + "/setup_wizard.js")['Welcome']; |
| 8 | const region = require(frappe_ui_tests_path + "/setup_wizard.js")['Region']; |
| 9 | const user = require(frappe_ui_tests_path + "/setup_wizard.js")['User']; |
| 10 | |
| 11 | module.exports = { |
| 12 | before: browser => { |
| 13 | browser |
| 14 | .url(browser.launch_url + '/login') |
| 15 | .waitForElementVisible('body', 5000); |
| 16 | }, |
| 17 | 'Login': login, |
| 18 | 'Welcome': welcome, |
| 19 | 'Region': region, |
| 20 | 'User': user, |
| 21 | 'Domain': browser => { |
| 22 | let slide_selector = '[data-slide-name="domain"]'; |
| 23 | browser |
| 24 | .waitForElementVisible(slide_selector, 2000) |
| 25 | .setValue('select[data-fieldname="domain"]', "Manufacturing") |
| 26 | .click(slide_selector + ' .next-btn'); |
| 27 | }, |
| 28 | 'Brand': browser => { |
| 29 | let slide_selector = '[data-slide-name="brand"]'; |
| 30 | browser |
| 31 | .waitForElementVisible(slide_selector, 2000) |
| 32 | .setValue('input[data-fieldname="company_name"]', "Acme") |
| 33 | .click(slide_selector + " .next-btn"); |
| 34 | }, |
| 35 | 'Organisation': browser => { |
| 36 | let slide_selector = '[data-slide-name="organisation"]'; |
| 37 | browser |
| 38 | .waitForElementVisible(slide_selector, 2000) |
| 39 | .setValue('input[data-fieldname="company_tagline"]', "Build tools for Builders") |
| 40 | .setValue('input[data-fieldname="bank_account"]', "YNG") |
| 41 | .click(slide_selector + " .next-btn"); |
| 42 | }, |
| 43 | |
| 44 | after: browser => { |
| 45 | browser.end(); |
| 46 | }, |
| 47 | }; |