Comments (9)
@janhesters You have to install the missing dependency yourself. You can add commands to install chrome dependencies in prebuild.
from amplify-hosting.
@garyleefight Do you know which dependencies and how to install them exactly?
I can't find how to install chrome for the Amplify console. I only found this, which tackles docker. And these Google docs are for Travis CI. As far as I can tell, there is no addons
key for the Amplify build settings.
from amplify-hosting.
@janhesters https://stackoverflow.com/questions/44516816/install-chrome-headless-using-npm
Hope it helps.
from amplify-hosting.
@garyleefight Thank you for your help. Managed to solve the install problem by adding
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
- yum install -y ./google-chrome-stable_current_*.rpm
to my build settings.
My question is now: How can I run yarn start so that the tests can pass? Currently the functional tests run, but fail, because no server is running.
from amplify-hosting.
@janhesters You can use https://stackoverflow.com/questions/30950032/how-can-i-run-multiple-npm-scripts-in-parallel concurrently package to run yarn start and your test command in parallel.
It will kill yarn start when your test commands finished. But the exit code is 1, which is considered build failure in our console.
You can read this post to get rid of exit code 1.
https://github.com/kimmobrunfeldt/concurrently/issues/127
Hope it works for you.
Besides, AWS Amplify Console baked Cypress test in the default image. You can choose it as an alternative selection.
Thanks,
Gary
from amplify-hosting.
You can use https://stackoverflow.com/questions/30950032/how-can-i-run-multiple-npm-scripts-in-parallel concurrently package to run yarn start and your test command in parallel.
It will kill yarn start when your test commands finished. But the exit code is 1, which is considered build failure in our console.
You can read this post to get rid of exit code 1.
kimmobrunfeldt/concurrently#127
Thank you I will try concurrently.
I also found the --app
flag for TestCafe which does exactly what I want (= run yarn start
when the test starts, and terminate the app afterwards). But, for some reason if I test in headless mode in the console or locally, the tests fail. I created a SO question here.
Besides, AWS Amplify Console baked Cypress test in the default image. You can choose it as an alternative selection.
Really? I didn't know that and could'n find anything in the docs about this. Do Cypress tests "just work"? Or is there extra configuration needed.
from amplify-hosting.
I got it working by adding a delay to launch the app.
"functional-tests": "testcafe 'chrome:headless' src/functional-tests/ --app 'yarn start' --app-init-delay 4000",
from amplify-hosting.
@janhesters Do you know the npm lib start-server-and-test (no need to add delay) ?
I achieve same tests with
start-server-and-test angular-http-server --path ./dist/site -p 4200 http://localhost:4200 testcafe chrome:headless ./testcafe/test.js
from amplify-hosting.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from amplify-hosting.
Related Issues (20)
- CloudFront cache always misses when uBlock Origin is disabled HOT 5
- FR: Would like to see console to be translated to HINDI. HOT 4
- Next.js 13 serving content from build time only HOT 4
- PR preview error HOT 1
- BUG: SSG Build failed : Failed to find the deploy-manifest.json file in the build output HOT 9
- BUG CICD is not deploying changes to the back-end HOT 1
- [BUG] - Unresolved/Auto-Closed User-Impacting Bug from 2022 Still Broken in 2024 HOT 4
- [BUG] !!! CustomerError: : Invalid Monorepo spec provided. The "appRoot" key needs to be a string HOT 11
- [BUG] Backend environment cache not used HOT 4
- In manual drag and drop deploy, main.js and style.js looks text/html content-type HOT 4
- [ERROR]: !!! CustomerError: Can't find required-server-files.json in build output directory HOT 4
- Be able to get Amplify project DNSSEC compliant HOT 4
- Is it possible to use 2 different platforms in one amplify app? HOT 5
- Issues with remote (backend) function building & size constraints ("Unzipped size must be smaller than..") HOT 3
- Staged Rollout Deployment for Amplify Hosted site HOT 1
- is there a way I can host an app in 2 different platforms HOT 11
- test branch deploy succesfull it gives 404 on domain which is hosted on amplifyapp.com HOT 4
- Command hook for frontend SSG deployments HOT 1
- TTFB is up to 8 seconds for a simple nextjs application HOT 5
- Nextjs 14 Backend Build faild with AWS Appsync and Cognito HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-hosting.