What is the best way to queue interactions and tests?
This works
describe('Dropdown', function() {
it("shows the fields", function() {
$('.dropdown-toggle').click();
expect($("#some-element-in-dropdown-to-be-visibla").length).toBeVisible();
});
});
But this doesn’t
describe('Dropdown', function() {
$('.dropdown-toggle').click();
it("shows the fields", function() {
expect($("#some-element-in-dropdown-to-be-visibla").length).toBeVisible();
});
});
I’m finding this to be annoying because if I want to queue interaction - test - new interaction - test etc, all I’ve find is to use nested describes like so:
describe('ActionAB', function() {
beforeEach(function() {
actionA();
});
it("has done action A", function() {
testA();
describe('ActionB', function() {
beforeEach(function() {
actionB();
});
it("has done action B", function() {
testB();
});
});
});
});
instead of
describe('ActionAB', function() {
actionA();
it("has done action A", function() {
testA();
});
actionB();
it("has done action B", function() {
testB();
});
});