-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add new address #300
base: trunk
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { test as base } from '@playwright/test'; | ||
import type { Task } from '../../../types/Task'; | ||
import type { FixtureTypes} from '../../../types/FixtureTypes'; | ||
import { Address } from '../../../types/ShopwareTypes'; | ||
|
||
export const AddNewAddress = base.extend<{ AddNewAddress: Task }, FixtureTypes>({ | ||
AddNewAddress: async ({ ShopCustomer, StorefrontAccountAddresses, StorefrontAccountAddressCreate }, use)=> { | ||
const task = (address: Address) => { | ||
return async function AddNewAddress() { | ||
|
||
await ShopCustomer.goesTo(StorefrontAccountAddresses.url()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put that line (goesTo) into the test so that It is more transparent where you create the address. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and we save execution time because the fixture ShopCustomer is large and takes much more time to generate compared to a simple page object. |
||
await StorefrontAccountAddresses.addNewAddressButton.click(); | ||
|
||
await StorefrontAccountAddressCreate.firstNameInput.fill(address.firstName); | ||
await StorefrontAccountAddressCreate.lastNameInput.fill(address.lastName); | ||
await StorefrontAccountAddressCreate.companyInput.fill(address.company); | ||
await StorefrontAccountAddressCreate.departmentInput.fill(address.department); | ||
await StorefrontAccountAddressCreate.streetInput.fill(address.street); | ||
await StorefrontAccountAddressCreate.zipcodeInput.fill(address.zipCode); | ||
await StorefrontAccountAddressCreate.cityInput.fill(address.city); | ||
await StorefrontAccountAddressCreate.countryDropdown.selectOption({label: address.country}); | ||
await StorefrontAccountAddressCreate.stateDropdown.selectOption({label: address.state}); | ||
|
||
await StorefrontAccountAddressCreate.saveAddressButton.click(); | ||
|
||
} | ||
}; | ||
|
||
await use(task); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having an issue cleaning up country data in after hook(409 conflict error), despite having added customer_address here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the address data is still in use when you try to delete it.