Files
SymphonyElectron/tests/spectron/toastFlashWhenOpenMultiApplication.spectron.js

69 lines
2.8 KiB
JavaScript
Raw Normal View History

const Application = require('./spectronSetup');
const WebDriver = require('./spectronWebDriver');
const { isMac } = require('../../js/utils/misc.js');
var app = new Application({
startTimeout: Application.getTimeOut(),
waitTimeout: Application.getTimeOut()
});
2018-09-12 10:09:57 +07:00
let webdriver,webActions, windowAction;
const WindowsAction = require('./spectronWindowsActions');
const WebActions = require('./spectronWebActions');
const specconst = require('./spectronConstants.js');
const Utils = require('./spectronUtils');
const ifc = require('./spectronInterfaces.js');
!isMac ? describe('Verify Flash notification in taskbar option when multiple applications are opened', () => {
2018-09-12 10:09:57 +07:00
jasmine.DEFAULT_TIMEOUT_INTERVAL = specconst.TIMEOUT_TEST_SUITE;
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
beforeAll(async (done) => {
try {
2018-09-12 10:09:57 +07:00
webdriver = await new WebDriver({ browser: 'chrome' })
app = await new Application({}).startApplication({ testedHost: specconst.TESTED_HOST, alwaysOnTop: true });
windowAction = await new WindowsAction(app);
2018-09-12 10:09:57 +07:00
webActions = await new WebActions(app);
webdriver.windowAction = windowAction;
webdriver.webActions = webActions;
await webdriver.startDriver();
done();
} catch (err) {
done.fail(new Error(`Unable to start application error: ${err}`));
};
});
afterAll((done) => {
if (app && app.isRunning()) {
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
app.stop().then(() => {
webdriver.close();
webdriver.quit();
done();
}).catch((err) => {
done();
});
}
});
/**
* Verify Flash notification in taskbar option when multiple applications are opened
* TC-ID: 47308146
* Cover scenarios in AVT-1083
*/
it('Verify Flash notification in taskbar option when multiple applications are opened', async () => {
2018-09-12 10:09:57 +07:00
await webdriver.login(specconst.USER_A);
await webdriver.createIM(specconst.USER_B.username);
2018-09-12 10:09:57 +07:00
await webdriver.createMIM([specconst.USER_B.username, specconst.USER_C.username]);
await webActions.login(specconst.USER_B);
await windowAction.reload();
2018-09-12 10:09:57 +07:00
await app.client.waitForVisible(ifc.SETTTING_BUTTON, Utils.toMs(50));
await windowAction.pressCtrlM();
await webdriver.clickLeftNavItem(specconst.USER_B.name);
let messages = [];
await messages.push(await Utils.randomString());
await messages.push(await Utils.randomString());
await messages.push(await Utils.randomString());
await webdriver.sendMessagesAndVerifyToast(messages);
});
}) : describe.skip();