Skip to content

Commit

Permalink
Merge pull request #123 from Chloe60492/develop-40044
Browse files Browse the repository at this point in the history
ref #40044 reset the branch to deal with the conflict
  • Loading branch information
apple843119 authored Apr 12, 2024
2 parents ee553ae + 4d37606 commit e91e8f2
Showing 1 changed file with 34 additions and 0 deletions.
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);
});
});

0 comments on commit e91e8f2

Please sign in to comment.