Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //const expect = require('chai').expect;
- //const equal = require('chai').equal;
- const assert = require('assert');
- const webdriver = require('selenium-webdriver');
- const driver = new webdriver.Builder().forBrowser('chrome').build();
- const Key = require('selenium-webdriver');
- const By = webdriver.By;
- describe('Desktop Login', () => {
- it('Retail', () => {
- driver.get('https://gepur.com').then(async () => {
- await driver.manage().window().maximize();
- await driver.findElement(By.className('h-account'))
- .then(el => el.click())
- .then(() => driver.findElement(By.id('loginform-email')))
- .then(el => el.sendKeys('login'))
- .then(() => driver.findElement(By.id('loginform-password')))
- .then(el => el.sendKeys('password'))
- .then(() => driver.findElement(By.css('button.btn-basik.btn-sm.btn-black')))
- .then(el => el.click());
- await driver.sleep(500);
- let siteUrl = await driver.getCurrentUrl();
- assert.equal(siteUrl, 'https://gepur.com/');
- //expect(siteUrl).to.equal('https://gepur.com/');
- await driver.quit();
- });
- });
- it('Wholesale', () => {
- driver.get('https://gepur.com').then(async () => {
- await driver.manage().window().maximize();
- await driver.findElement(By.className('h-account'))
- .then(el => el.click())
- .then(() => driver.findElement(By.id('loginform-email')))
- .then(el => el.sendKeys('login'))
- .then(() => driver.findElement(By.id('loginform-password')))
- .then(el => el.sendKeys('password'))
- .then(() => driver.findElement(By.css('button.btn-basik.btn-sm.btn-black')))
- .then(el => el.click());
- await driver.sleep(500);
- let siteUrl = await driver.getCurrentUrl();
- assert.equal(siteUrl, 'https://gepur.com/');
- //expect(siteUrl).to.equal('https://gepur.com/');
- await driver.quit();
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement