Beispiel #1
0
        public void getCreateFilm()
        {
            adminLogin();
            filmsPage.clickCreateButton();
            createFilmPage = new CreateFilmPage(driver);
            string text = createFilmPage.getTitle();

            Assert.AreEqual(text, "Add a new movie");
        }
Beispiel #2
0
        public void createFilmFailingTest()
        {
            adminLogin();
            filmsPage.clickCreateButton();
            createFilmPage = new CreateFilmPage(driver);
            //fill out all the fields
            createFilmPage.enterName("A");
            createFilmPage.enterUrl("A");
            createFilmPage.enterGenre("A");
            createFilmPage.enterDirector("A");
            createFilmPage.enterReleaseDate("A");
            createFilmPage.enterShortDescription("A");
            createFilmPage.enterStars("A");
            createFilmPage.clickSubmit();
            string firstMovieName = filmsPage.getFilmNameFromPosition(1);

            Assert.AreEqual("A Ghost Story", firstMovieName);
        }
Beispiel #3
0
        public void createFilmPostTest()
        {
            adminLogin();
            filmsPage.clickCreateButton();
            createFilmPage = new CreateFilmPage(driver);
            //fill out all the fields
            createFilmPage.enterName("A Film");
            createFilmPage.enterUrl("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png");
            createFilmPage.enterGenre("Comedy");
            createFilmPage.enterDirector("Director1");
            createFilmPage.enterReleaseDate("July 7, 2019 (United States)");
            createFilmPage.enterShortDescription("Description");
            createFilmPage.enterStars("Stars1, Stars2");

            createFilmPage.clickSubmit();
            string firstMovieName = filmsPage.getFilmName(1);

            Assert.AreEqual("A Film", firstMovieName);
        }
Beispiel #4
0
        public void createFilmPostFailingTest()
        {
            adminLogin();
            filmsPage.clickCreateButton();
            //Sending empty strings to all fields
            createFilmPage = new CreateFilmPage(driver);
            createFilmPage.emptyNameField();
            createFilmPage.emptyUrlField();
            createFilmPage.emptyGenreField();
            createFilmPage.emptyDirectorField();
            createFilmPage.emptyReleaseDateField();
            createFilmPage.emptyShortDescriptionField();
            createFilmPage.emptyStarsField();
            createFilmPage.clickSubmit();

            Assert.AreEqual("The Name field is required.", createFilmPage.getNameErrorMessage());
            Assert.AreEqual("The Image field is required.", createFilmPage.getUrlErrorMessage());
            Assert.AreEqual("The Genre field is required.", createFilmPage.getGenreErrorMessage());
            Assert.AreEqual("The Director field is required.", createFilmPage.getDirectorErrorMessage());
            Assert.AreEqual("The Release Date field is required.", createFilmPage.getReleaseDateErrorMessage());
            Assert.AreEqual("The Short Description field is required.", createFilmPage.getShortDescriptionErrorMessage());
            Assert.AreEqual("The Stars field is required.", createFilmPage.getStarsErrorMessage());
        }