Comments (9)
@mlsad3 What was the main pain trying to set it up? I'd love to make it easier...
from sorry-cypress.
Hi @agoldis , I think most of my problems are self-induced. Mostly around AWS :)
from sorry-cypress.
That said, I'll need to send you a link to my updates just so you know what I have had to do. For instance, for Director, I have it running on Elastic Beanstalk and launched using concurrently (launching multiple nodejs on the same machine). This means a couple things:
- I can't use PORT environment variable, since it is too specific, and had to rename it to SORRY_CYPRESS_DIRECTOR_PORT (I actually have been working on getting API and Dashboard up on same machine as well)
- I tried forwarding all traffic from my main nodejs, using Express, and sending it to the localhost:1234 (so that someone can point their Cypress to www.mywebsite.com/dev/testing/director instead of www.mywebsite.com:1234), but it seems like Cypress can't handle this.
- I instead setup the load balancer in AWS to point port 1234 to the Director, but the Load Balancer couldn't check the status of the Director (health) and so always thought it was broken. For this, I had to add an api.get("/status", res.send("looks good")) so that the service would know that the process was healthy. Probably should have just sent 200, oh well :)
- Unfortunately after a lot of work, I still haven't gotten Dashboard (or API) working correctly, as they don't fully support working through express. For instance my main app is enforcing sign-in permissions to Dashboard/API (using cookies), and then users navigate to www.mywebsite.com/dev/cypress to get run data. Too much to write about what I tried, so I'll just have to send my code for perusal :)
from sorry-cypress.
@mlsad3 thanks for sharing the details!
I've fixed the original issue you've reported 53e2f54
As for the rest, let me ask few more questions
I can't use PORT environment variable, since it is too specific, and had to rename it to SORRY_CYPRESS_DIRECTOR_PORT (I actually have been working on getting API and Dashboard up on same machine as well)
Was it because all the processes were running on the same machine and all were using the same PORT
env var?
I tried forwarding all traffic from my main nodejs, using Express, and sending it to the localhost:1234 (so that someone can point their Cypress to www.mywebsite.com/dev/testing/director instead of www.mywebsite.com:1234), but it seems like Cypress can't handle this.
Was it because cypress client does not support redirects?
I instead setup the load balancer in AWS to point port 1234 to the Director, but the Load Balancer couldn't check the status of the Director (health) and so always thought it was broken. For this, I had to add an api.get("/status", res.send("looks good")) so that the service would know that the process was healthy. Probably should have just sent 200, oh well :)
👍🏻
Unfortunately after a lot of work, I still haven't gotten Dashboard (or API) working correctly, as they don't fully support working through express. For instance my main app is enforcing sign-in permissions to Dashboard/API (using cookies), and then users navigate to www.mywebsite.com/dev/cypress to get run data. Too much to write about what I tried, so I'll just have to send my code for perusal :)
So you want restricted access to the dashboard and tried to create some kind of wrapper that lets users in?
I am wondering whether having CloudFormation / Terraform template with a single host / docker setup would make it easier for you to deploy the whole system.
If you have some already existing setup, may be we can enhance it and share?
from sorry-cypress.
My setup is pretty ugly at the moment, so I'm not sure how good it would be to enhance/share from. Sometime (not in the next few months unfortunately due to timeframes), I'd like to put the whole package into a single nodejs express process.
As for your questions:
The PORT issue was due to having all the processes running on the same machine and using the same PORT env variable.
I I'm not sure about Cypress client and redirects (I wasn't using redirects). Instead, my site was more like a proxy. Cypress client would make request, I would forward request to localhost:1234, and then respond back to the client with the resulting response. I think Cypress has issues when there are extra things after the host url. i.e. https://mywebsite.com versus https://mywebsite.com/dev/director. It just wouldn't run, but I didn't debug too deep into that.
Final question: Yes, I wanted to restrict access to particular users. I already had user infrastructure in my existing website. I had to mess around a bit in both API and Dashboard to ensure they could handle the extra endpoint "/dev/dashboard" and "/dev/api". I also added express into the API project so that the authentication cookies were sent in requests. ...but I kept hitting some issues with the API pinging the wrong URL, and the Dashboard/API interaction also hitting something weird. Sorry, I got down deep and got lost, so I probably can't explain everything :)
from sorry-cypress.
@mlsad3 alright, thanks for sharing the insights! Please tell me if 53e2f54 closes the issue for you
from sorry-cypress.
Hi @agoldis yes, it closes the issue. Thanks!
from sorry-cypress.
Hi @agoldis , I've pushed my changes out to my fork. Definitely not anything you would want to pull in (since you've already made changes to help) but just to give you an idea.
master...mlsad3:add-aws-eb-updates
Of note, you can see how my .env files' urls have extra paths after them (instead of http://localhost:3000, it is http://localhost:3000/testing/cypress/graphql). This caused me to go down other routes to get Dashboard / API working with those. Take a look at "ASSET_PATH" to see another example. And "playground" for another. In the end, I wasn't able to fully get API/Dashboard to work with the extra paths in urls, but I left in some comments.
...just in case you're curious. Thanks for your work!
from sorry-cypress.
@mlsad3 You made my day! Thanks for your generosity! I will take a look at the files!
from sorry-cypress.
Related Issues (20)
- No test running with false positive, "Group X has different specs for the same run. Make sure each group in run has the same specs." HOT 1
- Support Test Replay HOT 7
- MongoDB driver update HOT 3
- Something wrong about the useGetTestsFromProject() method when using --group command line parameter. HOT 3
- a problem opening the dashboard before everything worked fine
- Resolve CVE-2023-37903 vulnerability HOT 9
- With Cypress 13.2.0 error on run page: Cannot return null for non-nullable field InstanceStats.wallClockDuration HOT 2
- AWS DocumentDB connections broken when using retryable writes HOT 3
- Unable to run Cypress tests on gitlab using cypress-cloud HOT 11
- Add buttons to activate/deactivate project background color and see project running spec. HOT 2
- Unable to start Docker image HOT 2
- MongoError: Authentication failed. HOT 4
- Support filtering in Slack hook HOT 4
- Result not displayed on sorry cypress always failed HOT 6
- Consider Renaming project HOT 8
- Publish via post processing HOT 5
- Uploading screenshots to azure blob storage HOT 4
- Support Playwright HOT 12
- Add Teams Hook event 'Finished with the failed tests' HOT 3
- Rerun Failed Tests Not Only From Gitlab CI Specific Job HOT 2
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 sorry-cypress.