Skip to content
Snippets Groups Projects
Commit 2ac74e65 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

added test for menu-bar enabled and disabled elements

parent 07b9f59f
No related branches found
No related tags found
No related merge requests found
......@@ -41,10 +41,6 @@ export default appTarget => {
<WrappedGui
canCreateNew
backpackOptions={backpackOptions}
canRemix={false}
canSave={false}
canSaveAsCopy={false}
canShare={false}
/>,
appTarget);
};
import path from 'path';
import SeleniumHelper from '../helpers/selenium-helper';
const {
clickXpath,
findByXpath,
getDriver,
loadUri
} = new SeleniumHelper();
const uri = path.resolve(__dirname, '../../build/index.html');
let driver;
describe('Menu bar settings', () => {
beforeAll(() => {
driver = getDriver();
});
afterAll(async () => {
await driver.quit();
});
test('File->New should be enabled', async () => {
await loadUri(uri);
await clickXpath('//button[@title="Try It"]');
await clickXpath(
'//div[contains(@class, "menu-bar_menu-bar-item") and ' +
'contains(@class, "menu-bar_hoverable")][span[text()="File"]]'
);
await findByXpath('//*[li[span[text()="New"]] and not(@data-tip="tooltip")]');
});
test('File->Save now should NOT be enabled', async () => {
await loadUri(uri);
await clickXpath('//button[@title="Try It"]');
await clickXpath(
'//div[contains(@class, "menu-bar_menu-bar-item") and ' +
'contains(@class, "menu-bar_hoverable")][span[text()="File"]]'
);
await findByXpath('//*[li[span[text()="Save now"]] and @data-tip="tooltip"]');
});
test('File->Save as a copy should NOT be enabled', async () => {
await loadUri(uri);
await clickXpath('//button[@title="Try It"]');
await clickXpath(
'//div[contains(@class, "menu-bar_menu-bar-item") and ' +
'contains(@class, "menu-bar_hoverable")][span[text()="File"]]'
);
await findByXpath('//*[li[span[text()="Save as a copy"]] and @data-tip="tooltip"]');
});
test('Share button should NOT be enabled', async () => {
await loadUri(uri);
await clickXpath('//button[@title="Try It"]');
await findByXpath('//div[span[div[span[text()="Share"]]] and @data-tip="tooltip"]');
});
});
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