File size: 2,847 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<img alt="Abstract concept" src="https://cldup.com/gBB3Y0iOWl.jpg" />

# WordPress.com End to End Tests

Automated end-to-end acceptance tests for the [wp-calypso](https://github.com/Automattic/wp-calypso) client and WordPress.com.

## Resources

- [Overview](docs/overview.md)
- [Setup](docs/setup.md)
- [Test Environment](docs/test_environment.md)
- [Running tests on your machine](docs/tests_local.md)
- [Running tests on CI](docs/tests_ci.md)
- [Writing tests](docs/writing_tests.md)
- [Library objects](docs/library_objects.md)
- [Style Guide](docs/style_guide.md)
- [Patterns, Tricks, and Gotchas](docs/patterns_tricks_gotchas.md)
- [Debugging](docs/debugging.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Environment Variable](docs/environment_variables.md)

## Prerequisites

Calypso E2E requires the following:

- [NodeJS](https://nodejs.org/) at the version in the root package.json "engines" field. (Typically latest LTS.)
- The [yarn](https://github.com/yarnpkg/berry) version available in the repo.
- Dependencies such as [Typescript](https://typescript.org) and [Playwright](https://playwright.dev) are installed via yarn, and you can find information about the versions we use in ./package.json.

## Quick start

1. install `homebrew`.

```bash
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
```

2. install `nvm`.

```bash
brew install nvm
```

3. install the required nodeJS version.

```bash
nvm install <node_version>
```

4. use the installed nodeJS version.

```bash
nvm use <node_version>
```

5. enable `yarn` package manager.

```bash
corepack enable
```

6. clone this repository

```bash
git clone https://github.com/Automattic/wp-calypso.git
```

7. navigate to the cloned directory.

```bash
cd wp-calypso
```

_From this point on, all commands are executed within the `wp-calypso` root directory._

8. install project dependencies.

```bash
yarn install
```

9. obtain the secrets decryption key.

```bash
export E2E_SECRETS_KEY='Calypso E2E Config decode key from the Automattic secret store>'
```

10. [decrypt](docs/test_environment.md) the secrets file.

```bash
yarn workspace wp-e2e-tests decrypt-secrets
```

11. transpile the packages.

```bash
yarn workspace wp-e2e-tests build --watch
```

12. run test.

```bash
yarn workspace wp-e2e-tests test -- <test_path>
```

To run on calypso.localhost, don't forget the environment variable:

```bash
CALYPSO_BASE_URL=http://calypso.localhost:3000 yarn workspace wp-e2e-tests test -- <test_path>
```

## Advanced setup

Please refer to the [Advanced Setup](docs/setup.md) page.

## Contribute to E2E tests

Please refer to the [Writing Tests](docs/writing_tests.md) and [Style Guide](docs/style_guide.md) pages.

## Troubleshooting

Please refer to the [Troubleshooting](docs/troubleshooting.md) page.