Пример #1
0
        public void StudentCanRegisterAndSubmit(string forename, string surname, string email, string gender,
                                                string phoneNumber, string dob, string hobby, string address, string profile)
        {
            _fixture.DemoQaPages.PageStudentRegistrationForm().NavigateTo();

            // deliberately writing gherkin here which isn't tied to a UI (anti-patten)
            // the tests steps would then be hard coded to the UI which could change
            // the types of behaviours could be tested in a subcutaneous (underneath the UI)
            // manner too, beyond even an API to something like a system integration test which
            // calls a handler from the application code for example

            // https://www.ministryoftesting.com/dojo/lessons/introduction-to-subcutaneous-testing

            // could be an example of a given here but there's not really any initial
            // system context here so there's no test code to call
            "Given a student has no existing account"
            .x(() => { });

            "When the student registers providing all mandatory data"
            .x(() =>
            {
                _fixture.DemoQaPages.PageStudentRegistrationForm()
                .SendStudentName(forename, surname)
                .SendEmail(email)
                .SelectGender(gender)
                .SendPhoneNumber(phoneNumber)
                // deliberate bug in the dob field, I'm strongly against automating
                // complex controls like this
                .SendDateOfBirth(dob)
                .SelectHobby(hobby)
                .SendCurrentAddress(address)
                .UploadPicture(E2ETestFixture.TestFileLocation(profile))
                .Submit();
            });

            "Then the student is able to register"
            .x(() =>
            {
                Assert.True(_fixture
                            .DemoQaPages.PageStudentRegistrationForm().RegistrationCompleteModalOpen());
            });
        }
Пример #2
0
 public RegistrationTests(E2ETestFixture fixture, ITestOutputHelper output)
 {
     _output  = output;
     _fixture = fixture;
 }