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

ref #40044 reset the branch to deal with the conflict #123

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
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
34 changes: 34 additions & 0 deletions tests/playwright/tests/add_membership_type.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test.afterAll(async () => {
test.describe.serial('Create Membership Type', () => {
var organization = utils.makeid(10);
var membership_type = 'typeForTest';
var element;
test('Create Organization Contact', async () => {
await page.goto('civicrm/contact/add?reset=1&ct=Organization');
await utils.wait(wait_secs);
Expand Down Expand Up @@ -46,5 +47,38 @@ test.describe.serial('Create Membership Type', () => {
await page.locator('[id="_qf_MembershipType_upload-bottom"]').click();
await expect(page.getByRole('cell', { name: membership_type })).toHaveText(membership_type);
});
test('Create Membership', async ()=> {
var firstName = 'test_firstName';
var lastName = 'test_lastName';
var name = firstName + ' ' + lastName;
// go to create membership page
await page.goto('/civicrm/member/add?reset=1&action=add&context=standalone');

// create individual data
await page.locator('#profiles_1').selectOption('4');
await expect(page.getByRole('dialog')).toBeVisible();

element = await utils.findElementByLabel(page, '名字\n *');
await utils.fillInput(element, firstName);
element = await utils.findElementByLabel(page, '姓氏\n *');
await utils.fillInput(element, lastName);
await page.locator('#_qf_Edit_next').click();
await expect(page.locator('#contact_1')).toHaveValue(name);

// select the first option in the membership type and orginization
element = page.locator('[id="membership_type_id\\[0\\]"]');
// await utils.selectOption(page.locator(element), { index: 0 });
await element.selectOption(organization);
element = page.locator('[id="membership_type_id\\[1\\]"]');
await element.selectOption(membership_type);
// pick the first date
await page.locator('#join_date').click();
await page.getByRole('link', { name: '1', exact: true }).click();
await page.locator('#start_date').click();
await page.getByRole('link', { name: '1', exact: true }).click();
await page.locator('[id="_qf_Membership_upload-bottom"]').click();
// await utils.wait(wait_secs);
await expect(page).toHaveTitle(name + ' | netiCRM');
await expect(page.locator('#option11>tbody')).toContainText(membership_type);
});
});
Loading