Skip to content
Snippets Groups Projects
Commit fa751133 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Add integration test for list monitor.

Tests adding a list through the UI, the add <thing> blocks, the reported value and adding items using the monitor UI
parent 5096f13d
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,40 @@ describe('Working with the blocks', () => { ...@@ -90,6 +90,40 @@ describe('Working with the blocks', () => {
await expect(logs).toEqual([]); await expect(logs).toEqual([]);
}); });
test('Creating a list', async () => {
await loadUri(uri);
await clickXpath('//button[@title="tryit"]');
await clickText('Code');
await clickText('Variables', scope.blocksTab);
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation
await clickText('Make a List');
let el = await findByXpath("//input[@placeholder='']");
await el.sendKeys('list1');
await clickButton('OK');
// Click the "add <thing> to list" block 3 times
await clickText('add', scope.blocksTab);
await clickText('add', scope.blocksTab);
await clickText('add', scope.blocksTab);
await clickText('list1', scope.blocksTab);
await findByText('thing thing thing', scope.reportedValue); // Tooltip with result
// Interact with the monitor, adding an item
await findByText('list1', scope.monitors); // Just to be sure it is there
await clickText('+', scope.monitors);
el = await findByXpath(`//body//${scope.monitors}//input`);
await el.sendKeys('thing2');
await clickText('list1', scope.monitors); // Blur the input to submit
// Check that the list value has been propagated.
await clickText('list1', scope.blocksTab);
await findByText('thing thing thing thing2', scope.reportedValue); // Tooltip with result
const logs = await getLogs();
await expect(logs).toEqual([]);
});
test('Custom procedures', async () => { test('Custom procedures', async () => {
await loadUri(uri); await loadUri(uri);
await clickXpath('//button[@title="tryit"]'); await clickXpath('//button[@title="tryit"]');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment