mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
replaced eslint:recommended with prettier
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
'@tags': ['embedStream', 'login'],
|
||||
|
||||
before: (client) => {
|
||||
before: client => {
|
||||
client.setWindowPosition(0, 0);
|
||||
client.resizeWindow(1600, 1200);
|
||||
},
|
||||
@@ -13,12 +13,11 @@ module.exports = {
|
||||
done();
|
||||
},
|
||||
|
||||
after: (client) => {
|
||||
after: client => {
|
||||
client.end();
|
||||
},
|
||||
|
||||
'creates a new asset': (client) => {
|
||||
|
||||
'creates a new asset': client => {
|
||||
const asset = 'newAssetTest';
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
@@ -28,24 +27,20 @@ module.exports = {
|
||||
.ready();
|
||||
},
|
||||
|
||||
'creates an user and user logs in': (client) => {
|
||||
const {testData: {user}} = client.globals;
|
||||
'creates an user and user logs in': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
// Go back to default asset.
|
||||
const comments =
|
||||
embedStream
|
||||
.navigate()
|
||||
.ready();
|
||||
const comments = embedStream.navigate().ready();
|
||||
|
||||
comments
|
||||
.openLoginPopup((popup) => {
|
||||
popup.register(user);
|
||||
});
|
||||
comments.openLoginPopup(popup => {
|
||||
popup.register(user);
|
||||
});
|
||||
},
|
||||
'user posts a comment': (client) => {
|
||||
'user posts a comment': client => {
|
||||
const comments = client.page.embedStream().section.comments;
|
||||
const {testData: {comment}} = client.globals;
|
||||
const { testData: { comment } } = client.globals;
|
||||
|
||||
comments
|
||||
.waitForElementVisible('@commentBoxTextarea')
|
||||
@@ -53,39 +48,37 @@ module.exports = {
|
||||
.waitForElementVisible('@commentBoxPostButton')
|
||||
.click('@commentBoxPostButton')
|
||||
.waitForElementVisible('@firstCommentContent')
|
||||
.getText('@firstCommentContent', (result) => {
|
||||
.getText('@firstCommentContent', result => {
|
||||
comments.assert.equal(result.value, comment.body);
|
||||
});
|
||||
},
|
||||
|
||||
'signed in user sees comment history': (client) => {
|
||||
'signed in user sees comment history': client => {
|
||||
const profile = client.page.embedStream().goToProfileSection();
|
||||
const {testData: {comment}} = client.globals;
|
||||
const { testData: { comment } } = client.globals;
|
||||
|
||||
profile
|
||||
.waitForElementVisible('@myCommentHistory')
|
||||
.waitForElementVisible('@myCommentHistoryComment')
|
||||
.getText('@myCommentHistoryComment', (result) => {
|
||||
.getText('@myCommentHistoryComment', result => {
|
||||
profile.assert.equal(result.value, comment.body);
|
||||
});
|
||||
},
|
||||
'user sees replies and reactions to comments': (client) => {
|
||||
'user sees replies and reactions to comments': client => {
|
||||
const profile = client.page.embedStream().section.profile;
|
||||
|
||||
profile
|
||||
.waitForElementVisible('@myCommentHistory')
|
||||
.waitForElementVisible('@myCommentHistoryReactions')
|
||||
.waitForElementVisible('@myCommentHistoryReactionCount')
|
||||
.getText('@myCommentHistoryReactionCount', (result) => {
|
||||
.getText('@myCommentHistoryReactionCount', result => {
|
||||
profile.assert.equal(result.value, '0');
|
||||
});
|
||||
},
|
||||
'user goes to the stream and replies and reacts to comment': (client) => {
|
||||
'user goes to the stream and replies and reacts to comment': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = embedStream.goToCommentsSection();
|
||||
comments
|
||||
.waitForElementVisible('@respectButton')
|
||||
.click('@respectButton');
|
||||
comments.waitForElementVisible('@respectButton').click('@respectButton');
|
||||
|
||||
const profile = embedStream.goToProfileSection();
|
||||
|
||||
@@ -93,35 +86,32 @@ module.exports = {
|
||||
.waitForElementVisible('@myCommentHistory')
|
||||
.waitForElementVisible('@myCommentHistoryReactions')
|
||||
.waitForElementVisible('@myCommentHistoryReactionCount')
|
||||
.getText('@myCommentHistoryReactionCount', (result) => {
|
||||
.getText('@myCommentHistoryReactionCount', result => {
|
||||
profile.assert.equal(result.value, '1');
|
||||
});
|
||||
},
|
||||
'user logs out': (client) => {
|
||||
'user logs out': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = embedStream.goToCommentsSection();
|
||||
|
||||
comments
|
||||
.logout();
|
||||
comments.logout();
|
||||
},
|
||||
'not logged in user clicks my profile tab': (client) => {
|
||||
'not logged in user clicks my profile tab': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const profile = embedStream.goToProfileSection();
|
||||
|
||||
profile
|
||||
.assert.visible('@notLoggedIn');
|
||||
profile.assert.visible('@notLoggedIn');
|
||||
},
|
||||
'admin logs in': (client) => {
|
||||
const {testData: {admin}} = client.globals;
|
||||
'admin logs in': client => {
|
||||
const { testData: { admin } } = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
.navigate()
|
||||
.ready()
|
||||
.openLoginPopup((popup) => popup.login(admin));
|
||||
.openLoginPopup(popup => popup.login(admin));
|
||||
},
|
||||
'admin closes stream, users won\'t be able to perform some actions: reply ': (client) => {
|
||||
|
||||
"admin closes stream, users won't be able to perform some actions: reply ": client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
@@ -129,24 +119,19 @@ module.exports = {
|
||||
.waitForElementVisible('@firstComment')
|
||||
.waitForElementVisible('@replyButton');
|
||||
|
||||
embedStream
|
||||
.goToConfigSection()
|
||||
.closeStream();
|
||||
embedStream.goToConfigSection().closeStream();
|
||||
|
||||
embedStream
|
||||
.goToCommentsSection()
|
||||
.waitForElementVisible('@firstComment')
|
||||
.waitForElementNotPresent('@replyButton');
|
||||
|
||||
embedStream
|
||||
.goToConfigSection()
|
||||
.openStream();
|
||||
embedStream.goToConfigSection().openStream();
|
||||
},
|
||||
'admin logs out': (client) => {
|
||||
'admin logs out': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = embedStream.goToCommentsSection();
|
||||
|
||||
comments
|
||||
.logout();
|
||||
comments.logout();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user