From bbc24b26f5810f5f1f677c7ac26e0da443e7758a Mon Sep 17 00:00:00 2001 From: Chimbori Date: Thu, 18 Oct 2018 23:29:58 -0700 Subject: [PATCH] Add new golden file test for NYT Cooking. TODO: Make sure the Ingredients and Procedure are parsed correctly. #5 --- .../crux/articles/GoldenFilesTest.java | 8 + test_data/nyt-cooking.html | 1905 +++++++++++++++++ 2 files changed, 1913 insertions(+) create mode 100644 test_data/nyt-cooking.html diff --git a/src/test/java/com/chimbori/crux/articles/GoldenFilesTest.java b/src/test/java/com/chimbori/crux/articles/GoldenFilesTest.java index b4612e5..023568e 100644 --- a/src/test/java/com/chimbori/crux/articles/GoldenFilesTest.java +++ b/src/test/java/com/chimbori/crux/articles/GoldenFilesTest.java @@ -316,6 +316,14 @@ public void testNYT2() { assertEquals("https://cdn1.nyt.com/images/2010/12/22/world/22start-span/Start-articleLarge.jpg", article.imageUrl); } + @Test + public void testNYTCooking() { + Article article = TestHelper.extractFromTestFile("https://cooking.nytimes.com/recipes/1018068-chicken-paprikash", "nyt-cooking.html"); + assertEquals("Chicken Paprikash Recipe - NYT Cooking", article.title); + assertEquals("NYT Cooking", article.siteName); + assertStartsWith("Spices lose their flavor over time but few as quickly as paprika, which starts out tasting of pepper and sunshine", article.document.text()); + } + @Test public void testNature() { Article article = TestHelper.extractFromTestFile("http://www.nature.com/news/2011/110411/full/472146a.html", "nature.html"); diff --git a/test_data/nyt-cooking.html b/test_data/nyt-cooking.html new file mode 100644 index 0000000..6f1ef1a --- /dev/null +++ b/test_data/nyt-cooking.html @@ -0,0 +1,1905 @@ + + + + Chicken Paprikash Recipe - NYT Cooking + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + +
+ + + + +
+
+
+
+ + +
+ + +
+ +
+

+ Chicken Paprikash +

+
+ +
+ + +
    +
  • + Yield + Serves 4-6 +
  • +
  • + + Time + 1 hour +
  • +
+
+ +
+
+
+ + Save To Recipe Box +
+
+
+ + + Save + Saved +
+
Add to a collection +
+
+
+ +
+ + + + + +
+ +
+ +
+ +
+ Chicken Paprikash + +

+ Michael Kraus for The New York Times +

+
+ + +
+ + + + + + + + + + + + + +
+
+

Ingredients

+ +
    +
  • + + 3 to 4 + + + pounds chicken thighs and drumsticks, or whole chicken legs + +
  • +
  • + + + + + Kosher salt and freshly ground black pepper to taste + +
  • +
  • + + 1 + + + tablespoon neutral oil, like canola + +
  • +
  • + + 3 + + + tablespoons unsalted butter + +
  • +
  • + + 1 + + + large yellow or Spanish onion, peeled and diced + +
  • +
  • + + 3 + + + cloves garlic, peeled and minced + +
  • +
  • + + 3 + + + tablespoons Hungarian paprika, sweet or hot, or a combination + +
  • +
  • + + 3 + + + tablespoons all-purpose flour + +
  • +
  • + + 1 + + + cup canned crushed tomatoes or 1 large ripe tomato, chopped + +
  • +
  • + + 1 + + + cup chicken broth, homemade or, if not, low-sodium + +
  • +
  • + + 1 + + + pound egg noodles + +
  • +
  • + + ¾ + + + cup sour cream + +
  • +
+ +
+ +
+

Preparation

+
    +
  1. Heat oven to 400. Season the chicken aggressively with salt and pepper. Heat the oil and 1 tablespoon of the butter in a large, heavy, oven-safe sauté pan or Dutch oven set over high flame, until the butter is foaming. Sear the chicken in batches, skin-side down, until it is golden and crisp, approximately 5 to 7 minutes. Then turn the chicken over, and repeat on the other side, approximately 5 to 7 minutes. Remove chicken to a plate to rest.
  2. +
  3. Pour off all but a tablespoon or 2 of the accumulated fat in the pot. Return the pot to the stove, over medium heat, and add the onion. Cook, stirring frequently with a spoon to scrape off any browned bits of chicken skin, until the onion has softened and gone translucent, approximately 5 minutes. Add the garlic, and stir again, cooking it until it has softened, approximately 3 to 4 minutes. Add the paprika and the flour, and stir well to combine, then cook until the mixture is fragrant and the taste of the flour has been cooked out, approximately 4 to 5 minutes.
  4. +
  5. Add tomatoes and broth, whisk until smooth and then nestle the chicken back in the pan, skin-side up. Slide the pan or pot into the oven, and cook until the chicken has cooked through and the sauce has thickened slightly, approximately 25 to 30 minutes.
  6. +
  7. Meanwhile, set a large pot of heavily salted water to boil over high heat. Cook noodles in the water until they are almost completely tender, approximately 7 to 8 minutes. Drain the noodles, and toss them in a bowl with the remaining butter, then toss again to coat.
  8. +
  9. Place the chicken on top of the noodles, then add the sour cream to the sauce, stir to combine and ladle it over the whole.
  10. +
+ + +
+ + + + + +
+ Like this recipe? +
+
+
+ + Save To Recipe Box +
+
+
+ + + Save + Saved +
+
Add to a collection +
+
+
+ +
+ + + + + +
+ +
+ +
+ +
+
+
+
+ + +
+ + + + + + + + + + + +
+

+ More from Sam Sifton’s Suggestions +

+ + + + + + + + + + + + + +
+
+

+ More recipes from Sam Sifton +

+ + + + + +
+ + +
+ +
+

+ Brush Up On The Basics With Our Cooking Guides +

+ + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +