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

Add playground website #11

Merged
merged 5 commits into from
Feb 15, 2025
Merged

Conversation

ijpatricio
Copy link
Collaborator

@ijpatricio ijpatricio commented Feb 14, 2025

To start adding Operations and confirmations, we are better off with a own playground website.
Instead of asking, I promptly prepared a suggestion, which you can discard, of course.

Possibilities

We can:

  • Have a controlled environment to make scenarios, by controlling a website HTML and JS.
  • Potentially, in an isolated pipeline, we can install the package on the playground app (composer path), and assert the good behavior in a consumer scenario.

What was done

In the folder "playground" (gitattribute: export-ignore), There's a "laravel new" installation, without any starter kit.

In the playground, after a clean installation:

  • Committed the .env, as it's a dummy thing to be there.
  • Cleaned the welcome.blade.php view to a simple Title and body: Pest Browser Testing
  • All the rest is vanilla Laravel, and all .gitignore were maintained, except for .env

In the core repo:

  • Configured the Webserver that Playwright will handle in the background
  • Config for host and port and baseURL, so it can be defined in a single source of truth
  • Port 9357 to resemble PEST // 9 is the most similar with P, then 3E 5S 7T

Conclusion

  1. We can now write a tests like so. This one is added already:
it('can visit our website', function () {
    visit('/')
        ->toHaveTitle('Pest Browser Testing');
});

All green.

  1. I didn't do the "Playground as consumer" thing. Wanted your opinion, before doing it in a separate PR.

@ijpatricio
Copy link
Collaborator Author

Revisited and edited original post after a few QOL improvements

@nunomaduro nunomaduro merged commit e5ecf2b into pestphp:main Feb 15, 2025
0 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants