Привет Помогите пожалуйста сделать так чтоб:
1. Тесты запускались по очереди (после завершения первого теста, запускается второй, третий и так далее (только после завершения предыдущего))
2. каждый новый тест создает новое окно браузера.
Что-то я наворотил и немножко запутался ))
const expect = require('chai').expect; const equal = require('chai').equal; 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', (done) => { setTimeout(() => { 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('someLogin')) .then(() => driver.findElement(By.id('loginform-password'))) .then(el => el.sendKeys('somePasswd')) .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(); expect(siteUrl).to.equal('https://gepur.com/'); await driver.quit(); }); done(); }, 1000); }); it('Wholesale', (done) => { setTimeout(() => { 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('someLogin')) .then(() => driver.findElement(By.id('loginform-password'))) .then(el => el.sendKeys('somePasswd')) .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(); expect(siteUrl).to.equal('https://gepur.com/'); await driver.quit(); }); done(); }, 1000); }); });