Added feedback
This commit is contained in:
parent
d865ac8e06
commit
f46aabb4d3
8 changed files with 148 additions and 61 deletions
49
cucumber/features/steps_definitions/feedback.js
Normal file
49
cucumber/features/steps_definitions/feedback.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/* global module expect require process client */
|
||||
|
||||
const { randomText, randomEmail } = require('./helper.js');
|
||||
|
||||
module.exports = function doSteps() {
|
||||
this.Given(/^I am on the zones page$/, () => {
|
||||
client.url(`${process.env.ROOT_URL}/zones`);
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
});
|
||||
|
||||
this.Then(/^I can send feedback without email$/, () => {
|
||||
client.waitForVisible('#feedback-tab', 10000);
|
||||
client.click('#feedback-tab');
|
||||
client.waitForVisible('#feedback-form', 10000);
|
||||
client.setValue('#feedbackTextarea', randomText(500));
|
||||
client.click('#sendFeedbackBtn');
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
client.waitUntil(() => client.isVisible('.bert-alert') === false, 10000);
|
||||
});
|
||||
|
||||
this.Then(/^I can send feedback with email$/, () => {
|
||||
client.waitForVisible('#feedback-tab', 10000);
|
||||
client.click('#feedback-tab');
|
||||
client.waitForVisible('#feedback-form', 10000);
|
||||
client.setValue('input[name="email"]', randomEmail());
|
||||
client.setValue('#feedbackTextarea', randomText(500));
|
||||
client.click('#sendFeedbackBtn');
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
client.waitUntil(() => client.isVisible('.bert-alert') === false, 10000);
|
||||
});
|
||||
|
||||
this.Given(/^I'm not logged$/, () => {
|
||||
client.waitForVisible('#react-root', 5000);
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
});
|
||||
|
||||
this.Given(/^I am on the fires page$/, () => {
|
||||
client.url(`${process.env.ROOT_URL}/fires`);
|
||||
});
|
||||
|
||||
this.Then(/^I cannot send feedback$/, () => {
|
||||
client.waitForVisible('#react-root', 5000);
|
||||
client.waitUntil(() => client.isVisible('#feedback-tab') === false, 10000);
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue