Код: Выделить всё
getImageDetails.jsКод: Выделить всё
exports.command = async function() {
const specsAltText = await this.element('.specs-search-results__head-panel__image-container img').getAttribute('alt');
Код: Выделить всё
testingImageDetails.jsМой тестовый скрипт содержит:
Код: Выделить всё
var specsAltText = require('../getImageDetails');
describe('What is the alt text of the image', function() {
browser.getImageDetails(specsAltText);
console.log(specsAltText)
})
Код: Выделить всё
{ command: [AsyncFunction (anonymous)] }
Подробнее здесь: https://stackoverflow.com/questions/798 ... est-script
Мобильная версия