From bb947d46f43b46228bb5e1619ff1ac019ae65794 Mon Sep 17 00:00:00 2001 From: stoically Date: Wed, 18 Dec 2019 09:24:17 +0100 Subject: [PATCH] Add container feature test --- test/features/containers.test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/features/containers.test.js diff --git a/test/features/containers.test.js b/test/features/containers.test.js new file mode 100644 index 0000000..ac5bccd --- /dev/null +++ b/test/features/containers.test.js @@ -0,0 +1,28 @@ +describe("Containers Management", () => { + beforeEach(async () => { + await helper.browser.initializeWithTab(); + }); + + describe("creating a new container", () => { + beforeEach(async () => { + await helper.popup.clickElementById("container-add-link"); + await helper.popup.clickElementById("edit-container-ok-link"); + }); + + it("should create it in the browser as well", () => { + background.browser.contextualIdentities.create.should.have.been.calledOnce; + }); + + describe("removing it afterwards", () => { + beforeEach(async () => { + await helper.popup.clickElementById("edit-containers-link"); + await helper.popup.clickLastMatchingElementByQuerySelector(".delete-container-icon"); + await helper.popup.clickElementById("delete-container-ok-link"); + }); + + it("should remove it in the browser as well", () => { + background.browser.contextualIdentities.remove.should.have.been.calledOnce; + }); + }); + }); +}); \ No newline at end of file