Coder Social home page Coder Social logo

Comments (4)

DudaGod avatar DudaGod commented on June 9, 2024

Привет.

Подключить сервисы wdio к hermione возможности нет. Они подключаются только к wdio раннеру как плагины. В hermione wdio используется просто как API для общения с браузерами.

Логика работы emulateDevice

Все что делает emulateDevice так это просто в desiredCapabilities поля докидывает.
Код emulateDevice - https://github.com/webdriverio/webdriverio/blob/e61e1e4173a77c5bb42b32fba900d5ebfdae75b8/packages/wdio-devtools-service/src/index.ts#L165-L184.
Настройки девайсов берет из puppeteer - https://github.com/puppeteer/puppeteer/blob/c505c85b31eafe4b8e23a080b18887154507a851/packages/puppeteer-core/src/common/Device.ts#L27.

В итоге вместо этого можно написать что-то типа такого:

// .hermione.conf.ts

import { KnownDevices } from 'puppeteer-core'

browsers: {
  chrome: {
    desiredCapabilities: {
      browserName: 'chrome',
      browserVersion: '101.0',
      'goog:chromeOptions': {
        mobileEmulation: {
          ...KnownDevices['Pixel 5']
        }
      }
    }
  }
}

from testplane.

kirill-lalala avatar kirill-lalala commented on June 9, 2024

Спасибо за ответ!
Но что делать если я хочу подменить user-agent только для определенного теста?

from testplane.

DudaGod avatar DudaGod commented on June 9, 2024

Но что делать если я хочу подменить user-agent только для определенного теста?

Завести отдельный браузер с необходимым userAgent и запускать тест в нем. В рантайме для одного из тестов настройки браузера поменять нельзя.

from testplane.

kirill-lalala avatar kirill-lalala commented on June 9, 2024

Благодарю за ответ

from testplane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.