[Koha-bugs] [Bug 34076] [ALTERNATE] [DOCS] Automated screenshots using Cypress.io testing framework

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 13 12:57:57 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34076

Philip Orr <philip.orr at lmscloud.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |philip.orr at lmscloud.de

--- Comment #6 from Philip Orr <philip.orr at lmscloud.de> ---
Some notes from my testing. I'm not a dev and have no experience with git for
that matter so please correct me if I say something stupid.

All of this worked fine for me:
---
>>0.a Checkout the remote branch
>>% git remote add joubu https://gitlab.com/joubu/Koha/
>>% git fetch joubu
>>% git checkout -b cypress-studio joubu/cypress-studio
---
Note that it should be done in your git/Koha/ directory, that is, using your
terminal. Not in the ktd shell. :-)

I got an error here:
---
>>0.b start ktd up
---

The exact error message was:
koha-koha-1       | [tsl] ERROR in /kohadevbox/koha/cypress.config.ts(10,9)
koha-koha-1       |       TS2322: Type '{ setupNodeEvents(on: any, config:
any): any; experimentalStudio: true; baseUrl: string; specPattern: string;
supportFile: string; env: { db: { host: string; user: string; password: string;
database: string; }; }; }' is not assignable to type
'Partial<Omit<ResolvedConfigOptions, TestingType>>'.
koha-koha-1       |   Object literal may only specify known properties, and
'setupNodeEvents' does not exist in type 'Partial<Omit<ResolvedConfigOptions,
TestingType>>'.
koha-koha-1       | ts-loader-default_0c5a263502dc9404
koha-koha-1       |
koha-koha-1       | ERROR in /kohadevbox/koha/cypress.config.ts
koha-koha-1       | 28:8-31:9
koha-koha-1       | [tsl] ERROR in /kohadevbox/koha/cypress.config.ts(28,9)
koha-koha-1       |       TS2322: Type '{ devServer: { framework: string;
bundler: string; }; }' is not assignable to type
'Partial<Omit<ResolvedConfigOptions, TestingType>>'.
koha-koha-1       |   Object literal may only specify known properties, and
'devServer' does not exist in type 'Partial<Omit<ResolvedConfigOptions,
TestingType>>'.
koha-koha-1       | ts-loader-default_0c5a263502dc9404
koha-koha-1       |
koha-koha-1       | webpack 5.74.0 compiled with 2 errors in 5362 ms
koha-koha-1       | info Visit https://yarnpkg.com/en/docs/cli/run for
documentation about this command.
koha-koha-1       | error Command failed with exit code 1.
koha-koha-1       | error Command failed with exit code 1.
koha-koha-1       | info Visit https://yarnpkg.com/en/docs/cli/run for
documentation about this command.
koha-db-1         | 2023-07-13 10:15:21 12 [Warning] Aborted connection 12 to
db: 'koha_kohadev' user: 'koha_kohadev' host: '172.23.0.4' (Got an error
reading communication packets)
koha-db-1         | 2023-07-13 10:15:21 14 [Warning] Aborted connection 14 to
db: 'koha_kohadev' user: 'koha_kohadev' host: '172.23.0.4' (Got an error
reading communication packets)
koha-db-1         | 2023-07-13 10:15:21 13 [Warning] Aborted connection 13 to
db: 'koha_kohadev' user: 'koha_kohadev' host: '172.23.0.4' (Got an error
reading communication packets)
koha-koha-1 exited with code 1

I fixed it and I think there were two problems here.

First, I apparently hadn't installed yarn yet. Fixed with:

npm install --global yarn

Then I tried running "yarn install" in the terminal. I got the message:

The engine "node" is incompatible with this module. Expected version "8 || 9 ||
10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18". Got "20.3.1"

So it turns out I had Node.js version 20 already installed. You can install a
previous version e.g. 18 if you get the same error. I'm using nvm. So I used
the following commands:

nvm current node -v  # Checks your current version
nvm install <version>  # In this case I went for 18: nvm install 18

After that running "yarn install" worked correctly, though it warned about
missing dependencies.

[3/4] Linking dependencies...
warning " > bootstrap at 4.6.2" has unmet peer dependency "jquery at 1.9.1 - 3".
warning " > bootstrap at 4.6.2" has unmet peer dependency "popper.js@^1.16.1".

Anyway after all that, running "ktd up" works again without any error messages.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list