Synthetics test configuration

Hi elastic staff.

I got the error message from synthetic agent.
io:error executing step: Error: page.goto:net::ERR_CERT_AUTHORITY_INVALID at ..

So, I wanted to set ignoreHTTPSErrors to true and I found that playwright configurations can be applied globally by using configuration files, like synthetics.config.js or synthetics.config.ts
( Synthetic tests configuration | Observability Guide [7.14] | Elastic )

I set one of those files in the image during building docker customized image, I can not apply synthetic configurations for some errors.

  1. synthetics.config.ts
 I got error when importing the file that the above guide doc provides.
 2021-09-11T07:04:55.921Z        INFO    synthexec/synthexec.go:224      stdout: import { SyntheticsConfig } from "@elastic/synthetics"
2021-09-11T07:04:55.921Z        INFO    synthexec/synthexec.go:224      stdout: ^^^^^^
2021-09-11T07:04:55.921Z        INFO    synthexec/synthexec.go:224      stdout:
2021-09-11T07:04:55.921Z        INFO    synthexec/synthexec.go:224      stdout: SyntaxError: Cannot use import statement outside a module
  1. synthetic.config.js
const config = {
  playwrightOptions: {
    ignoreHTTPSErrors: true
  },
};

There were any errors while synthetic agents worked, but the configuration might not be applied because the certs error occurred.
I don't make sure that this config file is correct. I refereed to playwright configuration guide.
( Configuration | Playwright )

So, please guide synthetics.config.ts that can be imported and exported or synthetics.config.js which ignoreHTTPSErrors option can be applied.

Thank you in advance.

Thanks for the detailed post. I think we can improve the docs there. You cannot use the SyntheticsConfig type without being in an NPM module (which, in this case, means being in the same directory or subdirectory of a folder with a package.json). That said, you don't need to import the type at all. In our synthetics demo repo's synthetics.config.ts we don't do this in fact! I would copy the format of that file (which uses a more flexible function instead of constant settings anyway).

I've opened a docs improvement issue to fix the affected page as well. Thanks again!

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.