Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alecxe opened this issue Dec 16, 2016 · 0 comments

Comments

@alecxe
Copy link
Owner

alecxe commented Dec 16, 2016

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.

@alecxe alecxe added this to the 1.0 milestone Jun 30, 2017
@alecxe alecxe modified the milestones: 1.0, 2.0 Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant