More e2e testing on the Export Data feature

This commit is contained in:
Johnny Almonte
2020-03-29 15:50:08 -04:00
parent 7523e47cf1
commit 57a0ba33ea

View File

@@ -1,3 +1,5 @@
const moment = require('moment');
describe('Export Data', () => {
beforeEach(async () => {
await device.reloadReactNative();
@@ -18,4 +20,20 @@ describe('Export Data', () => {
await device.pressBack();
await expect(element(by.id('exportData-title'))).toHaveText('Export Data');
});
it('should export decrypted notes', async () => {
await expect(element(by.id('exportData-option-decrypted'))).toBeVisible();
await element(by.id('exportData-option-decrypted')).tap();
await element(by.text('SAVE TO DISK')).tap();
const lastExportDate = new Date();
await element(by.text('DONE')).tap();
await expect(element(by.id('exportData-title'))).toHaveText('Export Data');
const formattedDate = moment(lastExportDate).format('lll');
const lastExportString = `Last exported on ${formattedDate}`;
await expect(element(by.id('lastExportDate-text'))).toHaveText(lastExportString);
});
});