jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

Add a Playwright implementation of e2e tests #13755

Open mraible opened 3 years ago

mraible commented 3 years ago
Overview of the issue

Add an implementation of JHipster's e2e tests with Playwright.

I'm not sure this is necessary, but I figured I'd enter it here and put a bounty on it in case someone is interested.

Motivation for or Use Case

The least flaky system is the one we want for our CI processes.

Related issues

https://github.com/jhipster/generator-jhipster/issues/13723, https://github.com/jhipster/generator-jhipster/issues/13639

Suggest a Fix

Maybe Julien can get paid to do it?! 😉

atomfrede commented 3 years ago

You would like to use the typescript version or Java?

mraible commented 3 years ago

Both! What do you prefer? The final result should be an implementation and a good story about how it was achieved. :)

atomfrede commented 3 years ago

I guess the ts/node version will be much easier to implement as we have the testrunner etc. in place. Personally I would like to test out the java part (still thinking of doing a thymeleaf + tailwind + htmx + alpine blueprint and having all in java would be great), but totally fine with starting the ts version.

atomfrede commented 3 years ago

This seems as good blueprint candidate, what do you think?

atomfrede commented 3 years ago

I have a first example up and running using jest as test runner via https://github.com/playwright-community/jest-playwright. Fun to work with. Will try to put it into a blueprint for jh7

export class LoginPage {
  page: any;

  constructor(page: any) {
    this.page = page;
  }
  async navigate() {
    await this.page.goto('http://localhost:8080/login');
  }

  async login(username: string, password: string) {
    await this.page.fill('[data-cy="username"]', username);
    await this.page.fill('[data-cy="password"]', password);
    await this.page.click('[data-cy="submit"]');
    await this.page.waitForNavigation();
  }
}
import { LoginPage } from '../models/login';

let loginPage: LoginPage;

beforeEach(async () => {
  loginPage = new LoginPage(page);
  await loginPage.navigate();
});

test('should login', async () => {
  await loginPage.login('admin', 'admin');
  await page.goto('http://localhost:8080');
  await page.waitForSelector('[data-cy="adminMenu"]');
});
avdev4j commented 3 years ago

I'm not against adding a new tool but I would like to go ahead on Cypress by using the Cypress Dashboard for the JHipster organization.

Maybe it will help on this subject.

https://docs.cypress.io/guides/dashboard/flaky-test-management.html#Flake-Detection

atomfrede commented 3 years ago

Having it as a blueprint doesn't hurt. Thinking of having the choice between node/ts and java eventually. Not sure how easy it will be to keep up with upstream changes for a blueprint doing e2e tests.

pascalgrimaud commented 3 years ago

Yes, it will go to blueprint or module

atomfrede commented 3 years ago

Should it be an "official" blueprint or just keep it under https://github.com/atomfrede/generator-jhipster-playwright for now? Maybe @jdubois has a preference?

jdubois commented 3 years ago

Oh I missed this thread! I'm in contact with the Playwright team at Microsoft, I'll ask them if they want to join.

atomfrede commented 3 years ago

I am going to start a small blog post series about how to create a playwright blueprint. Will try to start this weekend, what do you think?

pascalgrimaud commented 3 years ago

I'm fine

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

mraible commented 3 years ago

@atomfrede is working on this.

On Mar 18, 2021, at 20:32, github-actions[bot] @.***> wrote:

 This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs 😃. Comment or this will be closed in 7 days

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 3 years ago

Keep it open

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

atomfrede commented 2 years ago

Keep it open

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

DanielFran commented 1 year ago

@atomfrede I saw your commits in July 2022. Is this done?

atomfrede commented 1 year ago

Sadly no. I created a blueprint skeleton with Marcelo at the last jhipster off-site but didn't finish it.

deepu105 commented 1 year ago

is there still interest in this else lets close it cc @atomfrede

atomfrede commented 1 year ago

I would like to have it. Do we consider the blueprint api for jh8 stable now? Did not continue work as there were so many moving parts, it was hard to keep up, with @mshima being on :fire: :)