Skip to content

Instantly share code, notes, and snippets.

@wlsf82
Created January 4, 2017 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlsf82/2b065a21c0cd8046a29cdd470ce1a452 to your computer and use it in GitHub Desktop.
Save wlsf82/2b065a21c0cd8046a29cdd470ce1a452 to your computer and use it in GitHub Desktop.
// This is how the test is today.
"use strict";
const AppearInRoom = require("../page-objects/appearInRoom");
const Helper = require("../helper");
const RoomActivity = require("../page-objects/roomActivity");
const shortid = require("shortid");
describe("Activity list", () => {
const appearInRoom = new AppearInRoom();
const helper = new Helper();
const roomActivity = new RoomActivity();
let randomRoomName;
beforeEach(() => {
randomRoomName = shortid.generate();
appearInRoom.visit(randomRoomName);
helper.clickWhenClickable(roomActivity.refreshButton);
helper.sleepForNSeconds(3);
});
it("should remove item from the activity list", () => {
roomActivity.listItems.count().then((numberOfItemsBeforeRemoval) => {
roomActivity.removeFirstItem();
helper.sleepForNSeconds(3);
roomActivity.listItems.count().then((numberOfItemsAfterRemoval) => {
expect(numberOfItemsAfterRemoval).toEqual(numberOfItemsBeforeRemoval - 1);
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment