Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a functional test for content preview #15208

Open
sebastienros opened this issue Jan 30, 2024 · 17 comments
Open

Create a functional test for content preview #15208

sebastienros opened this issue Jan 30, 2024 · 17 comments
Milestone

Comments

@sebastienros
Copy link
Member

cf #15181

@Piedone
Copy link
Member

Piedone commented Jan 31, 2024

Eh? #11194

@hishamco
Copy link
Member

I planned for a while to introduce Playwright as a testing framework to handle various types of testing, if all agree I will prepare a demo

@sebastienros
Copy link
Member Author

It's fine using playwright, but the simplicity of the current functional tests should be kept. Noting that as simple as it is, nobody creates new ones :/ Maybe at some point we'll start asking for some in PRs. I have been personally shying about it, but on my other repositories it's usually well accepted, though these are more low level libraries.

@hishamco
Copy link
Member

I like software testing very much, that's why I like other repos: YesSQL, Fluid, and Parlot :) I was planned to create an OS testing library specialized for OC, something similar to what Lombiq did but simpler :)

@Piedone
Copy link
Member

Piedone commented Feb 1, 2024

UI testing is not simple and can't be done in a simple way either. You have to have complexity if you want to actually get some value out of the tests.

Under #11194 I've implemented this. I really fail to see the value in reinventing the wheel with Playwright or Cypress.

Believe me, it starts small, like "I just need this test to click around a bit", but it doesn't until you have intricate knowledge of browser behavior, the UI testing ecosystem, CI systems, .NET idiosyncracies, the logging infrastructure, and an immense amount of other stuff. UI testing is not unit testing where everything just works.

@sebastienros
Copy link
Member Author

Not reinventing the wheel. Cypress has been there for years in OC already, working fine, we just need to add scenarios with features. What I am asking here is just a request to the page to ensure the main element is rendered to check the content preview feature is not completely broken.

Example:

  • Create a file like this
  • Add a couple of Visit/Check to ensure the feature works

Idea is to find a balance between full coverage and not blocking external contributions because we ask too much.

@Piedone
Copy link
Member

Piedone commented Feb 1, 2024

Yep, that's how it starts ;).

@hishamco
Copy link
Member

hishamco commented Feb 1, 2024

UI testing is not unit testing where everything just work

Playwrite is promising there are many many features for UI & integration tests

@sebastienros sebastienros added this to the 1.x milestone Feb 8, 2024
@Skrypt
Copy link
Contributor

Skrypt commented Feb 16, 2024

Ok, we have also an issue with the current Cypress tests. The environment is set to Production and we run these tests on http instead of https and we would need to fix the npm package that @jptissot did years ago so that it start on https. That could be an easy fix if we had the npm package repository credentials but I'd rather invest time on Playwright at this point.

And that's me after wasting an hour figuring out the issue with my PR. 😄

@hishamco
Copy link
Member

but I'd rather invest time on Playwright at this point.

Let me know if you need a help on this, coz I already invested time on Playwright, it's promising

@Skrypt
Copy link
Contributor

Skrypt commented Feb 16, 2024

What I'm thinking is that we could easily keep Cypress old tests and create new ones with Playwright and then migrate Cypress ones to Playwright progressively.

@Skrypt
Copy link
Contributor

Skrypt commented Feb 16, 2024

@hishamco Please share a repository if you can. I've barely just started trying to use it with the VS Code extension. Question I'm asking myself is if we need to create a lot of boilerplate TS code like we have for Cypress (js npm package) to create tenants and else.

@Piedone
Copy link
Member

Piedone commented Feb 16, 2024

Why bring in another JS testing framework, and with TS on top of it, when we can write tests in C#? Even with Playwright.

@Skrypt
Copy link
Contributor

Skrypt commented Feb 16, 2024

I need to see how it all works still, I've seen C# support but the VS Code extension seems to leverage the TS tests.
I personally don't dislike TypeScript to be honest. It's easier to read/maintain than plain javascript at least. Now, not everything should/can be C# and Blazor. All of these have their own limitations/drawback. Need to live with it.

@hishamco
Copy link
Member

Why bring in another JS testing framework, and with TS on top of it, when we can write tests in C#? Even with Playwright.

Totally agree, during my testing and investigation I'm using .NET. Probably I will do a demo if I have a time

@Skrypt
Copy link
Contributor

Skrypt commented Feb 17, 2024

I like the VS Code UI functionaly and the Chromium browser automated browsing display. Also the fact that we can record these tests and it will write code for it. Looks more like Cypress to me without the complexity. Playwright allows for both styles of tests client and server side so I would not limit myself to only one type of test.

@hishamco
Copy link
Member

Hopefully, I will demo some of the Playwright features this week or after

@Piedone Piedone modified the milestones: 2.x, 2.1 May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants