Skip to content

Performance audit on specific page via browser.performAudit() function #197

@josip1001

Description

@josip1001

I would like to run performance audit on specific page via browser.performAudit() function.
I have prepared wdio script as followed:

describe('Example', () => {
  it('open example homepage', async () => {
    await browser.url('https://example.com/')
  })

  it('performance audit', async () => { await browser.performAudit(await browser.getUrl()) })

I have got error:

[chrome 117.0.5938.89 windows #0-0] » \test\test.js
[chrome 117.0.5938.89 windows #0-0] Example
[chrome 117.0.5938.89 windows #0-0] ✓ open example homepage
[chrome 117.0.5938.89 windows #0-0] ✖ performance audit
[chrome 117.0.5938.89 windows #0-0]
[chrome 117.0.5938.89 windows #0-0] 1 passing (584ms)
[chrome 117.0.5938.89 windows #0-0] 1 failing
[chrome 117.0.5938.89 windows #0-0]
[chrome 117.0.5938.89 windows #0-0] 1) Example performance audit
[chrome 117.0.5938.89 windows #0-0] browser.performAudit is not a function
[chrome 117.0.5938.89 windows #0-0] TypeError: browser.performAudit is not a function

Can you help me how to implement and add performance audit into wdio script?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions