Skip to content

Commit b84ab89

Browse files
committed
+2 tests
1 parent 307ca95 commit b84ab89

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Selector } from 'testcafe';
2+
3+
fixture('create-testplan-active-private').page(process.env.TL_URL);
4+
5+
const fake = require('faker');
6+
let name = fake.commerce.productName();
7+
let active = '1';
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+
.click(Selector('#testplan_mgmt').find('[name="active"]'))
23+
.click(Selector('#testplan_mgmt').find('[name="do_create"]'));
24+
25+
/* checks */
26+
let row = Selector('tr').withAttribute('data-qa-tplan-name',name);
27+
await t
28+
.expect(row.visible).ok()
29+
.expect(row.find('td').withAttribute('data-qa-active',active).visible).ok()
30+
.expect(row.find('td').withAttribute('data-qa-is_public',is_public).visible).ok();
31+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Selector } from 'testcafe';
2+
3+
fixture('create-testplan-active-public').page(process.env.TL_URL);
4+
5+
const fake = require('faker');
6+
let name = fake.commerce.productName();
7+
let active = '1';
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+
.click(Selector('#testplan_mgmt').find('[name="active"]'))
23+
.click(Selector('#testplan_mgmt').find('[name="is_public"]'))
24+
.click(Selector('#testplan_mgmt').find('[name="do_create"]'));
25+
26+
/* checks */
27+
let row = Selector('tr').withAttribute('data-qa-tplan-name',name);
28+
await t
29+
.expect(row.visible).ok()
30+
.expect(row.find('td').withAttribute('data-qa-active',active).visible).ok()
31+
.expect(row.find('td').withAttribute('data-qa-is_public',is_public).visible).ok();
32+
});

0 commit comments

Comments
 (0)