# Synthetics test configuration

**URL:** <https://discuss.elastic.co/t/synthetics-test-configuration/284150>\
**Category:** Synthetics\
**Created:** [September 14, 2021, 6:39am UTC](https://discuss.elastic.co/t/synthetics-test-configuration/284150 "2021-09-14T06:39:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinmaeng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinmaeng/32/85734_2.png) [@shinmaeng](https://discuss.elastic.co/u/shinmaeng)\
**Post date:** [September 14, 2021, 6:39am UTC](https://discuss.elastic.co/t/synthetics-test-configuration/284150/1 "2021-09-14T06:39:22Z")

</div>

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](https://www.elastic.co/guide/en/observability/7.14/synthetics-configuration.html) )

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

```auto
 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

```auto
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](https://playwright.dev/docs/test-configuration/) )

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.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [September 29, 2021, 1:10pm UTC](https://discuss.elastic.co/t/synthetics-test-configuration/284150/2 "2021-09-29T13:10:49Z")

</div>

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](https://github.com/elastic/synthetics-demo/blob/main/todos/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](https://github.com/elastic/observability-docs/issues/1105) to fix the affected page as well. Thanks again!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 23, 2021, 1:11pm UTC](https://discuss.elastic.co/t/synthetics-test-configuration/284150/3 "2021-10-23T13:11:07Z")

</div>

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