canarytrace / documentation

Plug’n'Play stack for testing and monitoring web applications from user perspective.
http://canarytrace.com
6 stars 0 forks source link

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

Open josip1001 opened 1 year ago

josip1001 commented 1 year ago

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?