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

test: items under trip existence #948

Merged
merged 8 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test.describe('About Page Tests', () => {
await page.goto('/')
await page.getByRole('link', { name: 'אודות' }).click()
await page.getByRole('link', { name: 'Applitools' }).click()
await expect(page).toHaveURL('https://applitools.com/')
await expect(page).toHaveURL('https://www.applitools.com/')
await page.goto('/about')
const page1Promise = page.waitForEvent('popup')
await page.getByRole('link', { name: 'pch.vector' }).click()
Expand Down
20 changes: 18 additions & 2 deletions tests/tripExistence.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import { test } from './utils'
import { test, expect, urlMatcher } from './utils'

test('choosing params in "קיום נסיעות" and organize by date/hour ', async ({ page }) => {
test.beforeEach(async ({ page, advancedRouteFromHAR }) => {
advancedRouteFromHAR('tests/HAR/menu.har', {
updateContent: 'embed',
update: false,
notFound: 'abort',
url: /stride-api/,
matcher: urlMatcher,
})
await page.goto('/')
Copy link
Member

Choose a reason for hiding this comment

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

That's so cool, I'm so glad to see you're using it! How was your experience?
By the way, feel free to record a separate HAR file for this file:

Suggested change
advancedRouteFromHAR('tests/HAR/menu.har', {
updateContent: 'embed',
update: false,
notFound: 'abort',
url: /stride-api/,
matcher: urlMatcher,
})
advancedRouteFromHAR('tests/HAR/tripExistence.har', {
updateContent: 'embed',
update: true,
notFound: 'abort',
url: /stride-api/,
matcher: urlMatcher,
})

After running one test with this version, update can be switched to back false.

(Only if you want to try it out, don't feel obligated)

Copy link
Collaborator Author

@YaelChen YaelChen Dec 1, 2024

Choose a reason for hiding this comment

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

Thanks! I'm playing with some trial and error and I've made all sorts of mistakes here :) but I seem to have finally fixed it, and also made a new HAR as you wrote, and pushed it :)

Copy link
Member

Choose a reason for hiding this comment

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

That's so exciting! I'm truly happy to see it. If you have any feedback regarding the developer experience, I would really like to improve things were possible.
The advanced har library is also a project that I maintain so please feel comfortable leaving feedback and ideas and we can improve it as well.

})

test('Trip Existence page items', async ({ page }) => {
await page.getByRole('link', { name: 'קיום נסיעות' }).click()
const itemsInOrder = ['קיום נסיעות', 'הקווים הגרועים ביותר', 'אחוזי יציאה מסך הנסיעות לפי יום']
await expect(page.locator('h2')).toContainText(itemsInOrder)
})

test('choosing params in "קיום נסיעות" and organize by date/hour ', async ({ page }) => {
await page.getByRole('link', { name: 'קיום נסיעות' }).click()
await page.getByLabel('התחלה').click()
await page.getByLabel('התחלה').fill('02/6/2024')
Expand Down
Loading