<commit_before>package org.allga.tests;

import org.testng.annotations.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

/**
 * Created by Olga on 29.03.2016.
 */
public class MovieDeletionTests extends TestBase {

    @Test
    public void testDeletionMovie()  {
        getNavigationHelper().goToHomePage();
        int before = getMovieHelper().countAllMovies();
        getMovieHelper().allMovies().get(0).click();
        getMovieHelper().deleteMovie();
        getNavigationHelper().goToHomePage();
        int after = getMovieHelper().countAllMovies();
        assertThat(after, equalTo(before - 1));
    }

}<commit_msg>to MovieDeletionTests added comparing and waiting<commit_after>package org.allga.tests;

import org.allga.model.MovieData;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import java.util.List;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

/**
 * Created by Olga on 29.03.2016.
 */
public class MovieDeletionTests extends TestBase {

    @Test
    public void testDeletionMovie()  {
        getNavigationHelper().goToHomePage();
        getMovieHelper().waitMovies();
        List<MovieData> moviesBefore = getMovieHelper().getAllMovies();

        getMovieHelper().allMovies().get(0).click();
        getMovieHelper().deleteMovie();

        (new WebDriverWait(driver, 5)).until(ExpectedConditions.presenceOfElementLocated(By.tagName("h1")));
        getNavigationHelper().goToHomePage();
        getMovieHelper().waitMovies();
        List<MovieData> moviesAfter = getMovieHelper().getAllMovies();
        assertThat(moviesAfter.size(), equalTo(moviesBefore.size() - 1));
    }

}
{'fraction_non_alphanumeric': 0.12479827864443249, 'fraction_numerical': 0.011834319526627219, 'mean_word_length': 4.068119891008174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3134697', 'n_tokens_mistral': 598, 'n_tokens_neox': 547, 'n_words': 94}