describe('Example usage of @interopio/wdio-iocd-service', () => {
    it('should have access to browser.io()', async () => {
        console.log('test start');
        // A fully working io.Connect Desktop client
        const io = await browser.io();
        console.log('io object ready', io.version);

        expect(io).toHaveAttribute('appManager');
        expect(io).toHaveAttribute('contexts');
        expect(io).toHaveAttribute('channels');
    });

    it('should raise a test notifications, and then navigate to notifications panel', async () => {
        const io = await browser.io();
        await io.notifications.configure({ enable: true });
        await io.notifications.raise({
            title: 'Test Notification title',
            body: 'Test Notification body',
            toastExpiry: 999999,
        });

        await browser.switchToLaunchpad();

        await browser.$('.launchpad-header-notifications-button button').waitAndClick();

        await browser.switchToNotificationsPanel();

        await browser.pause(2000);
    });
});
