Skip to content

Commit 3b5b01c

Browse files
committed
+2 tests
1 parent b84ab89 commit 3b5b01c

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Selector } from 'testcafe';
2+
3+
fixture('create-testplan-inactive-private').page(process.env.TL_URL);
4+
5+
const fake = require('faker');
6+
let name = fake.commerce.productName();
7+
let active = '0';
8+
let is_public = '0';
9+
10+
test('create-testplan', async t => {
11+
await t
12+
.typeText(Selector('#tl_login'), 'admin')
13+
.typeText(Selector('#tl_password'), 'admin')
14+
.pressKey('enter')
15+
.switchToIframe(Selector('[name="mainframe"].siteContent'))
16+
.click(Selector('a').withText('Test Plan Management'))
17+
.click(Selector('[name="bottomCreateForm"]').find('[name="create_testplan"]'));
18+
19+
/* fill the form */
20+
await t
21+
.typeText(Selector('#testplan_mgmt').find('[name="testplan_name"]'), name);
22+
23+
if (active == '1') {
24+
await t
25+
.click(Selector('#testplan_mgmt').find('[name="active"]'));
26+
}
27+
if (is_public == '1') {
28+
await t
29+
.click(Selector('#testplan_mgmt').find('[name="is_public"]'))
30+
}
31+
32+
await t
33+
.click(Selector('#testplan_mgmt').find('[name="do_create"]'));
34+
35+
/* checks */
36+
let row = Selector('tr').withAttribute('data-qa-tplan-name',name);
37+
await t
38+
.expect(row.visible).ok()
39+
.expect(row.find('td').withAttribute('data-qa-active',active).visible).ok()
40+
.expect(row.find('td').withAttribute('data-qa-is_public',is_public).visible).ok();
41+
});
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Selector } from 'testcafe';
2+
3+
fixture('create-testplan-inactive-public').page(process.env.TL_URL);
4+
5+
const fake = require('faker');
6+
let name = fake.commerce.productName();
7+
let active = '0';
8+
let is_public = '1';
9+
10+
test('create-testplan', async t => {
11+
await t
12+
.typeText(Selector('#tl_login'), 'admin')
13+
.typeText(Selector('#tl_password'), 'admin')
14+
.pressKey('enter')
15+
.switchToIframe(Selector('[name="mainframe"].siteContent'))
16+
.click(Selector('a').withText('Test Plan Management'))
17+
.click(Selector('[name="bottomCreateForm"]').find('[name="create_testplan"]'));
18+
19+
/* fill the form */
20+
await t
21+
.typeText(Selector('#testplan_mgmt').find('[name="testplan_name"]'), name);
22+
23+
if (active == '1') {
24+
await t
25+
.click(Selector('#testplan_mgmt').find('[name="active"]'));
26+
}
27+
if (is_public == '1') {
28+
await t
29+
.click(Selector('#testplan_mgmt').find('[name="is_public"]'))
30+
}
31+
32+
await t
33+
.click(Selector('#testplan_mgmt').find('[name="do_create"]'));
34+
35+
/* checks */
36+
let row = Selector('tr').withAttribute('data-qa-tplan-name',name);
37+
await t
38+
.expect(row.visible).ok()
39+
.expect(row.find('td').withAttribute('data-qa-active',active).visible).ok()
40+
.expect(row.find('td').withAttribute('data-qa-is_public',is_public).visible).ok();
41+
});

0 commit comments

Comments
 (0)