Fix tests creating FeedItems just once because of duplicate IDs (#7148)

This commit is contained in:
ByteHamster 2024-04-28 22:11:37 +02:00 committed by GitHub
parent 35817876bf
commit 257c3bca5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ public class TextOnlyFeedsTest {
onDrawerItem(withText(feed.getTitle())).perform(click()); onDrawerItem(withText(feed.getTitle())).perform(click());
onView(withText(feed.getItemAtIndex(0).getTitle())).perform(click()); onView(withText(feed.getItemAtIndex(0).getTitle())).perform(click());
onView(isRoot()).perform(waitForView(withText(R.string.mark_read_no_media_label), 3000)); onView(isRoot()).perform(waitForView(withText(R.string.mark_read_no_media_label), 3000));
onView(withText(R.string.mark_read_no_media_label)).perform(click()); onView(allOf(withText(R.string.mark_read_no_media_label), isDisplayed())).perform(click());
onView(isRoot()).perform(waitForView(allOf(withText(R.string.mark_read_no_media_label), not(isDisplayed())), 3000)); onView(isRoot()).perform(waitForView(allOf(withText(R.string.mark_read_no_media_label), not(isDisplayed())), 3000));
} }

View File

@ -128,13 +128,13 @@ public class UITestUtils {
// create items // create items
List<FeedItem> items = new ArrayList<>(); List<FeedItem> items = new ArrayList<>();
for (int j = 0; j < NUM_ITEMS_PER_FEED; j++) { for (int j = 0; j < NUM_ITEMS_PER_FEED; j++) {
FeedItem item = new FeedItem(j, "Feed " + (i+1) + ": Item " + (j+1), "item" + j, FeedItem item = new FeedItem(0, "Feed " + (i+1) + ": Item " + (j+1), "item" + j,
"http://example.com/feed" + i + "/item/" + j, new Date(), FeedItem.UNPLAYED, feed); "http://example.com/feed" + i + "/item/" + j, new Date(), FeedItem.UNPLAYED, feed);
items.add(item); items.add(item);
if (!hostTextOnlyFeeds) { if (!hostTextOnlyFeeds) {
File mediaFile = newMediaFile("feed-" + i + "-episode-" + j + ".mp3"); File mediaFile = newMediaFile("feed-" + i + "-episode-" + j + ".mp3");
item.setMedia(new FeedMedia(j, item, 0, 0, mediaFile.length(), "audio/mp3", null, hostFile(mediaFile), false, null, 0, 0)); item.setMedia(new FeedMedia(0, item, 0, 0, mediaFile.length(), "audio/mp3", null, hostFile(mediaFile), false, null, 0, 0));
} }
} }
feed.setItems(items); feed.setItems(items);