penny-university / penny_university

5 stars 6 forks source link

Colin/integration test rework #375

Closed ghost closed 3 years ago

ghost commented 4 years ago

This solution is extremely hacky and more time consuming, but it's definitely better than the old tests.

I added in documentation for those new to Cypress as well.

Notes:

todo

JnBrymn commented 4 years ago

This looks like a hopeful approach. Do you think you can demo it on Tuesday for us?

On thing to consider is that the ultimate goal is to be able to stick this into a bash script and just run it. If we can do that, then we will be able to stick it in the GitHub action and replace the existing integration tests. In this regard I'm a little concerned about the cookie stuff. It feels like that could cause these tests to be brittle.

There are 3 files that appear to be boilerplate and not really have any content. Do we need them? Should we delete them.

ghost commented 4 years ago

On thing to consider is that the ultimate goal is to be able to stick this into a bash script and just run it. If we can do that, then we will be able to stick it in the GitHub action and replace the existing integration tests.

I believe this would be possible - the one fear I have is that you'd be exposing sign in cookies publicly in the file but it should also be possible to use it in the repo's secrets and use that.

It definitely seems brittle, but from the looks of it it's the only option that gets around their security measures. Luckily, if we can find out if the sign in cookies hold up over time, it could definitely be a possibility to run it headless in the action. Only change that would need to be made for that is there would need to be an existing "mock" server running in a dev workspace to use for these tests, not sure yet how I could make that happen in the test itself.

There are 3 files that appear to be boilerplate and not really have any content. Do we need them? Should we delete them.

plugins/index.js, commands.js, and commands/index.js should be able to be deleted without any harm, will push up a commit with that change shortly here.

Do you think you can demo it on Tuesday for us?

Sure can! Will throw it up into the PennyHack doc for the agenda.

ghost commented 4 years ago

Correction - looks like those 3 files can't be deleted. Cypress instantly regenerates them as soon as it is opened.

ghost commented 3 years ago

One month later, this test does still work (surprisingly)! It took an extra minute or two to open up, which I assume translates to it refreshing the token, but it went through (until it failed because my bot wasn't online). @JnBrymn @nchouard

JnBrymn commented 3 years ago

Well, so we do need easier integration tests. Let's talk about this at the meeting tonight. I think the remainder of this issue is:

ghost commented 3 years ago

Turning this into a draft while I finalize this this week. Sorry this is taking so long, I've been trying to finish up some big work projects + this KOA event user testing starts this week.