2021-02-25 20:39:59 +00:00
|
|
|
export const migrationMessageShown = async app => {
|
|
|
|
await app.client.waitUntilTextExists(
|
|
|
|
'.onboarding__content__body p strong',
|
|
|
|
'Migrate from Insomnia Designer',
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const clickSkip = async app => {
|
2021-02-25 23:01:46 +00:00
|
|
|
const button = await app.client.react$('MigrationBody').then(e => e.$(`button=Skip for now`));
|
2021-02-25 20:39:59 +00:00
|
|
|
await button.waitForClickable();
|
|
|
|
await button.click();
|
|
|
|
};
|
|
|
|
|
2021-02-25 23:01:46 +00:00
|
|
|
export const toggleOption = async (app, label) => {
|
|
|
|
const toggle = await app.client
|
2021-02-25 20:39:59 +00:00
|
|
|
.$('.onboarding__content__body')
|
2021-02-25 23:01:46 +00:00
|
|
|
.then(e => e.react$(`BooleanSetting`, { props: { label } }));
|
|
|
|
await toggle.waitForClickable();
|
|
|
|
await toggle.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
const _getStartButton = async app => {
|
|
|
|
return await app.client.react$('MigrationBody').then(e => e.$(`button=Start Migration`));
|
|
|
|
};
|
|
|
|
|
|
|
|
export const clickStart = async app => {
|
|
|
|
const button = await _getStartButton(app);
|
2021-02-25 20:39:59 +00:00
|
|
|
await button.waitForClickable();
|
|
|
|
await button.click();
|
|
|
|
};
|
|
|
|
|
2021-02-25 23:01:46 +00:00
|
|
|
export const ensureStartNotClickable = async app => {
|
|
|
|
const button = await _getStartButton(app);
|
|
|
|
await button.waitForClickable({ reverse: true });
|
|
|
|
};
|
|
|
|
|
2021-02-25 20:39:59 +00:00
|
|
|
export const successMessageShown = async app => {
|
|
|
|
await app.client.waitUntilTextExists(
|
|
|
|
'.onboarding__content__body p strong',
|
|
|
|
'Migrated successfully!',
|
|
|
|
10000, // Wait 10 seconds for migration to complete
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const clickRestart = async app => {
|
|
|
|
await app.client
|
2021-02-25 23:01:46 +00:00
|
|
|
.react$('MigrationBody')
|
2021-02-25 20:39:59 +00:00
|
|
|
.then(e => e.$(`button=Restart Now`))
|
|
|
|
.then(e => e.click());
|
|
|
|
};
|