gns3-web-ui/e2e/controllers.e2e-spec.ts

44 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-02-07 15:52:12 +00:00
import { TestHelper } from './helpers/common.po';
import { ControllersPage } from './helpers/controller.po';
2020-02-07 12:57:32 +00:00
describe('Controllers page', () => {
let page: ControllersPage;
2021-04-12 11:15:45 +00:00
let helper: TestHelper;
beforeEach(() => {
page = new ControllersPage();
2021-04-12 11:15:45 +00:00
helper = new TestHelper();
});
xit('user should have possibility to add controller', async () => {
2021-04-12 11:15:45 +00:00
// arrange
page.maximizeWindow();
await page.navigateToControllersPage();
2021-04-12 11:15:45 +00:00
// act
let text = await page.getAddControllerNotificationText();
2021-04-12 11:15:45 +00:00
// assert
expect(text).toBe("We've discovered GNS3 controller on 127.0.0.1:3080, would you like to add to the list?");
2021-04-12 11:15:45 +00:00
});
it('user should see added controller in the list', async () => {
2021-04-12 11:15:45 +00:00
// arrange
page.maximizeWindow();
await page.navigateToControllersPage();
await page.clickAddController();
2021-04-12 11:15:45 +00:00
helper.sleep(1000);
// act
let firstRowOfControllersTable = await page.checkControllersTable();
let controllerData = [];
await helper.asyncForEach(firstRowOfControllersTable, async (element) => {
controllerData.push(await element.getText());
2020-02-07 15:52:12 +00:00
});
2020-02-07 12:57:32 +00:00
2021-04-12 11:15:45 +00:00
// assert
expect(controllerData).toContain('127.0.0.1');
expect(controllerData).toContain('3080');
2021-04-12 11:15:45 +00:00
});
2020-02-07 12:57:32 +00:00
});