Skip to content

Rule Proposal: warn if control flow functions are executed outside of jasmine  #63

@alecxe

Description

@alecxe

If inside a spec file, protractor specific code, which needs to be executed inside a control flow, is not put under beforeEach(), afterEach(), beforeAll(), afterAll() or it(), the rule should produce an error.'

Example of a violation:

describe('clicking loging out button', function () {
        browser.sleep(2000);
        element(by.css('[href="/account/signout"]')).click();

        it('should redirect to account page', function () {
            expect(browser.getCurrentUrl()).toEqual('https://localhost:44311/account');
        });

        it('should display a signed out message', function () {
            expect(element(by.css('text-success')).getText()).toEqual('You have successfully signed out');
        });
});

See how browser.sleep(2000); and element(by.css('[href="/account/signout"]')).click(); are right under the describe.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions