You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test currently checks for the first link in the list. It would be better to add tests for specific blog post links to ensure that dynamic content is loaded correctly. Also, uncomment or remove the commented-out test case.
Suggested implementation:
test('homepage navigation and blog content loads correctly',async({ page })=>{awaitpage.goto(TARGET_URL);// Test navigation linksawaitexpect(page.getByRole('link',{name: 'ML Readme'})).toBeVisible();awaitexpect(page.getByRole('link',{name: 'Home'})).toBeVisible();awaitexpect(page.getByRole('link',{name: 'About',exact: true})).toBeVisible();// Test blog posts are loadedawaitexpect(page.getByRole('link',{name: 'Byte-Pair Encoding (BPE)'})).toBeVisible();awaitexpect(page.locator('ul.blog-posts-list > li')).toHaveCount(3);// Assuming we expect at least 3 blog posts// Test specific blog post linksawaitexpect(page.getByRole('link',{name: 'Byte-Pair Encoding (BPE)'})).toBeVisible();awaitexpect(page.getByRole('link',{name: 'Getting Started with Machine Learning'})).toBeVisible();});
Note: You may need to:
Adjust the blog post titles to match the actual titles in your application
Update the expected count of blog posts (.toHaveCount(3)) to match your actual expected number
Add or modify the CSS selector for the blog posts list (ul.blog-posts-list) to match your actual HTML structure
The test currently checks for the first link in the list. It would be better to add tests for specific blog post links to ensure that dynamic content is loaded correctly. Also, uncomment or remove the commented-out test case.
Suggested implementation:
Note: You may need to:
.toHaveCount(3)
) to match your actual expected numberul.blog-posts-list
) to match your actual HTML structureOriginally posted by @sourcery-ai[bot] in #80 (comment)
The text was updated successfully, but these errors were encountered: