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

E2E Test Expansion #475

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

CGBassPlayer
Copy link
Collaborator

@CGBassPlayer CGBassPlayer commented Oct 26, 2022

Adds more page tests to website

  • 404 Page
    • Check for unicorn image
    • Check for "Page Not Found" text
  • Episode Page (1 episode each since this is templated?) (5 newest, 5 oldest, and any other predefined episodes we want to test)
    • Tab title contains show name, episode number, and JB
    • Podverse Player
    • Support and Subscribe Buttons
    • Show Image
    • Hosts / Guests
    • Sponsors
    • Links
    • Tags
  • Show Page (Should we iterate over all shows or just pick 1 since it is templated?) (All Shows)
    • pagination (similar to home page test)
    • Icons
    • Hosts
  • Calendar
    • Screenshot Moved to playwright handling automatically
    • Check dropdown
  • Membership
    • Show membership links are present?
  • People (Hosts and Guests)
    • Guest Pagination
    • All Hosts are present
  • Live
    • Embedded player
    • Way to mock JB being live to check live light?

@CGBassPlayer CGBassPlayer added dev Related to the development environment QA quality assurance (automated testing with playwright) labels Oct 26, 2022
@gerbrent
Copy link
Collaborator

  • Should we iterate over all shows or just pick 1 since it is templated?

Feels asthough we don't need to iterate over EVERY episode, but only 1 seems almost too restrictive and could make dangerous assumptions (i.e. if $latest_episode is OK, they're all OK!). Suggestion: testing the latest 5 episodes and the oldest 5 episodes?

  • Way to mock JB being live to check live light?

Maybe this is a helpful starting point? #378 (comment)

@CGBassPlayer
Copy link
Collaborator Author

CGBassPlayer commented Oct 28, 2022

Suggestion: testing the latest 5 episodes and the oldest 5 episodes?

Do you think 5 newest across all shows or per show?

Also I would advocate for the possibility of picking a specific set of episodes that we should test because not all episodes have guests and I want make sure the Guests section of the episode page is check every time when E2E is run.

@gerbrent
Copy link
Collaborator

gerbrent commented Oct 28, 2022

great points @CGBassPlayer !

  • 5 newest and 5 oldest of every show (since some shows are unique in their strangeness.. who knows what we'll find!)
  • in addition, we could/should also pick some known-useful episodes, as you mentioned. great idea.

@CGBassPlayer
Copy link
Collaborator Author

...known-useful episodes...

I think that LUP 434 is a great candidate and one I use when working on the episode page layout

@elreydetoda elreydetoda linked an issue Nov 3, 2022 that may be closed by this pull request
"""
@fixture(autouse=True)
def setup(page: Page):
page.goto("/404.html")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, for testing the 404 page...should we navigate to it or navigate to a non-existent page and check attributes on that? That way we can test the actual functionality to make sure it's working properly... I don''t know if it really matters either way, but just thinking out loud 🙃

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say test a random (optionally clever or humorous) URL of your choosing!

Copy link
Collaborator Author

@CGBassPlayer CGBassPlayer Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we run the test against a development container that uses hugo serve any url that does not have an actual page returns the old 404
local 404
The redirect only works if you have a real web server in front of it to redirect so I have to use 404.html in order to test the 404 page

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's very odd...I'll have to dig into this more, because when I run the hugo serve -D locally (outside of the container with the snap'ed version of hugo) it worked perfectly fine... 🤔

image

Copy link
Collaborator

@elreydetoda elreydetoda Nov 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah....so it looks like it was an improvement between 101 -> 105 when the hugo serve command received 404 support.

https://github.com/gohugoio/hugo/releases/tag/v0.103.0

Which is why it was working for me, because hugo just updates in the background with the snap package. 😅

I'll do another PR to upgrade the main prod container's version + dev, then we'll be able to properly do 404 testing locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once that PR is merged, I will update to a random url (maybe randomly generated? Or give me some ideas for fun urls!). In the meantime I will keep it as 404.html

@elreydetoda
Copy link
Collaborator

Also, I've listed out a bunch of other things/info here: #286 (comment)

You've got most of it with your initial comment for this PR, but just figured I'd toss it in to help with some of the things like mocking the request.

@elreydetoda
Copy link
Collaborator

...known-useful episodes...

I think that LUP 434 is a great candidate and one I use when working on the episode page layout

Also, here are some episodes that were particularly tricky from the scrapers perspective. We might want to include those as well:

https://github.com/JupiterBroadcasting/show-scraper/blob/48f0833e63a8473eb8afa6d2297942aeb487b139/scraper.py#L524-L537

@CGBassPlayer
Copy link
Collaborator Author

CGBassPlayer commented Nov 5, 2022

So I managed to find a way to build the urls for the episodes we want. I grabs the 5 oldest, and 5 newest episodes per show as well as a whatever we populate in a dictionary in the file. I will look through to see what other edge cases in the issues @elreydetoda pointed out. But the part I think would be the hardest is over. Testing time locally took like 7 minutes through the first run, looking at GH Actions it seems to have taken only 30 seconds.

@elreydetoda
Copy link
Collaborator

BTW @CGBassPlayer, once this stuff gets merged: ChanceM#1

We'll have the live page indicator + mocking (mainly just intercepting the live request and responding with an event and not actual mocking) taken care of.

@CGBassPlayer CGBassPlayer added the in progress currently being worked on label Feb 6, 2023
@CGBassPlayer CGBassPlayer reopened this Mar 1, 2023
@CGBassPlayer
Copy link
Collaborator Author

Not sure why they PR closed when I pulled the latest changes in... My best guess would be because I rebased my changes on top and so the commit history for my branch has changed? No totally sure. But seems like it good again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Related to the development environment in progress currently being worked on QA quality assurance (automated testing with playwright)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deployment smoke tests
4 participants