Commit c2d596e1 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

lint

parent cb1368cf
......@@ -71,7 +71,7 @@ describe('Application life cycle test', function () {
});
it('can set and view a "burn after reading" message only once', function(done) {
const message = "Burn After Reading secret message";
const message = 'Burn After Reading secret message';
browser.get('https://' + app.fqdn).then(function() {
return browser.findElement(by.xpath('//input[@id="burnafterreading"]')).click();
......@@ -113,7 +113,7 @@ describe('Application life cycle test', function () {
});
it('can upload and download and read a simple text file', function(done) {
const message = "Upload/Download Text File secret message";
const message = 'Upload/Download Text File secret message';
const testFilePath = `${path.resolve(__dirname, '.')}/test.txt`;
browser.get('https://' + app.fqdn).then(function() {
......@@ -155,13 +155,13 @@ describe('Application life cycle test', function () {
}).then(function() {
return browser.findElement(by.tagName('body')).getText();
}).then(function(bodyContents) {
expect(bodyContents).to.be.equal("Test txt file upload");
expect(bodyContents).to.be.equal('Test txt file upload');
done();
});
});
it('can set a message and delete it before it has been accessed', function(done) {
const message = "Immediate Delete secret message";
const message = 'Immediate Delete secret message';
let binUrl;
browser.get('https://' + app.fqdn).then(function() {
......@@ -174,7 +174,7 @@ describe('Application life cycle test', function () {
return browser.findElement(by.id('pasteurl')).getText();
}).then(function(pasteUrl) {
// pasteUrl is our unique secret URL
binUrl = pasteUrl
binUrl = pasteUrl;
return ;
}).then(function() {
// Click on 'Delete Data' button
......@@ -200,60 +200,60 @@ describe('Application life cycle test', function () {
});
it('can set and view a message only with the proper password', function(done) {
const message = "Password protected secret message";
const password = "some$ecr3tPassw0rd!";
browser.get('https://' + app.fqdn).then(function() {
return browser.findElement(by.id('passwordinput')).sendKeys(password);
}).then(function() {
return browser.findElement(by.id('message')).sendKeys(message);
}).then(function() {
return browser.findElement(by.id('sendbutton')).click();
}).then(function() {
return browser.sleep(5000);
}).then(function() {
return browser.findElement(by.id('pasteurl')).getText();
}).then(function(pasteUrl) {
// pasteUrl is our unique secret URL
return ;
}).then(function() {
return browser.navigate().refresh();
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('passworddecrypt')).sendKeys('wrongPassword');
}).then(function() {
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with wrong password
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('errormessage')).getText();
}).then(function(text) {
const lowerCaseText = text.toLowerCase();
expect(lowerCaseText).to.contain("wrong password");
expect(lowerCaseText).to.contain("retry");
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('retrybutton')).click();
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('passworddecrypt')).sendKeys(password);
}).then(function() {
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with correct password
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('prettyprint')).getText();
}).then(function(text) {
expect(text).to.equal(message);
done();
});
});
const message = 'Password protected secret message';
const password = 'some$ecr3tPassw0rd!';
browser.get('https://' + app.fqdn).then(function() {
return browser.findElement(by.id('passwordinput')).sendKeys(password);
}).then(function() {
return browser.findElement(by.id('message')).sendKeys(message);
}).then(function() {
return browser.findElement(by.id('sendbutton')).click();
}).then(function() {
return browser.sleep(5000);
}).then(function() {
return browser.findElement(by.id('pasteurl')).getText();
}).then(function(pasteUrl) {
// pasteUrl is our unique secret URL
return ;
}).then(function() {
return browser.navigate().refresh();
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('passworddecrypt')).sendKeys('wrongPassword');
}).then(function() {
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with wrong password
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('errormessage')).getText();
}).then(function(text) {
const lowerCaseText = text.toLowerCase();
expect(lowerCaseText).to.contain('wrong password');
expect(lowerCaseText).to.contain('retry');
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('retrybutton')).click();
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('passworddecrypt')).sendKeys(password);
}).then(function() {
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with correct password
}).then(function() {
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('prettyprint')).getText();
}).then(function(text) {
expect(text).to.equal(message);
done();
});
});
it('can set and view a 5 minute timed message only for 5 minutes', function(done) {
const message = "Five minute timed secret message";
const message = 'Five minute timed secret message';
this.timeout(950000);
browser.get('https://' + app.fqdn).then(function() {
......@@ -306,15 +306,15 @@ describe('Application life cycle test', function () {
});
it('can create a burn after reading, password protected, file upload bin that will be present after a backup and restore', function(done) {
const message = "Password protected, burn after reading, uploaded file secret message, with a backup and restore";
const password = "some$ecr3tPassw0rd!";
const message = 'Password protected, burn after reading, uploaded file secret message, with a backup and restore';
const password = 'some$ecr3tPassw0rd!';
const testFilePath = `${path.resolve(__dirname, '.')}/test.txt`;
var binUrl;
browser.get('https://' + app.fqdn).then(function() {
return browser.findElement(by.xpath('//input[@id="burnafterreading"]')).click();
}).then(function() {
return browser.findElement(by.id('passwordinput')).sendKeys(password);
return browser.findElement(by.id('passwordinput')).sendKeys(password);
}).then(function() {
return browser.findElement(by.id('message')).sendKeys(message);
}).then(function() {
......@@ -348,9 +348,9 @@ describe('Application life cycle test', function () {
}).then(function() {
return browser.findElement(by.id('passworddecrypt')).sendKeys(password);
}).then(function() {
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with correct password
return browser.findElement(by.xpath('//form[@id="passwordform"]/button[@type="submit"]')).click(); // Try to unlock bin with correct password
}).then(function() {
return browser.sleep(3000);
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('prettyprint')).getText();
}).then(function(text) {
......@@ -371,11 +371,11 @@ describe('Application life cycle test', function () {
}).then(function() {
return browser.findElement(by.tagName('body')).getText();
}).then(function(bodyContents) {
expect(bodyContents).to.be.equal("Test txt file upload");
expect(bodyContents).to.be.equal('Test txt file upload');
}).then(function() {
return browser.get(binUrl);
}).then(function() {
return browser.sleep(3000);
return browser.sleep(3000);
}).then(function() {
return browser.findElement(by.id('prettyprint')).getText();
}).then(function(text) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment