本文整理汇总了Java中tools.fastlane.screengrab.Screengrab.screenshot方法的典型用法代码示例。如果您正苦于以下问题:Java Screengrab.screenshot方法的具体用法?Java Screengrab.screenshot怎么用?Java Screengrab.screenshot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools.fastlane.screengrab.Screengrab
的用法示例。
在下文中一共展示了Screengrab.screenshot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: takeScreenshotsOfOpenWithAndShare
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void takeScreenshotsOfOpenWithAndShare() throws Exception {
/* Open_With View */
UiObject openWithBtn = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/open_select_browser")
.enabled(true));
assertTrue(openWithBtn.waitForExists(waitingTime));
openWithBtn.click();
UiObject shareList = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/apps")
.enabled(true));
assertTrue(shareList.waitForExists(waitingTime));
Screengrab.screenshot("OpenWith_Dialog");
/* Share View */
UiObject shareBtn = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/share")
.enabled(true));
device.pressBack();
TestHelper.menuButton.perform(click());
assertTrue(shareBtn.waitForExists(waitingTime));
shareBtn.click();
TestHelper.shareAppList.waitForExists(waitingTime);
Screengrab.screenshot("Share_Dialog");
device.pressBack();
}
示例2: testTakeScreenshot
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void testTakeScreenshot() {
sleep(1000);
Screengrab.screenshot("transaction_list");
onView(withId(R.id.menu_layout)).perform(click());
clickMenu(0);
// sleep(1000);
Screengrab.screenshot("security_center");
Espresso.pressBack();
clickMenu(1);
sleep(1000);
Screengrab.screenshot("support");
Espresso.pressBack();
clickMenu(3);
// sleep(1000);
Screengrab.screenshot("unlock_screen");
}
示例3: takeScreenshotsOfBrowsingView
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void takeScreenshotsOfBrowsingView() {
assertTrue(TestHelper.inlineAutocompleteEditText.waitForExists(waitingTime));
Screengrab.screenshot("LocationBarEmptyState");
/* Autocomplete View */
onView(withId(R.id.urlView))
.check(matches(isDisplayed()))
.check(matches(hasFocus()))
.perform(click(), replaceText("mozilla"));
assertTrue(TestHelper.hint.waitForExists(waitingTime));
Screengrab.screenshot("SearchFor");
onView(withId(R.id.urlView))
.check(matches(isDisplayed()))
.check(matches(hasFocus()))
.perform(click(), replaceText(webServer.url("/").toString()), pressImeActionButton());
device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/webview")
.enabled(true))
.waitForExists(waitingTime);
onView(withId(R.id.display_url))
.check(matches(isDisplayed()))
.check(matches(withText(containsString(webServer.getHostName()))));
Screengrab.screenshot("BrowserView");
}
示例4: takeAddToHomeScreenScreenshot
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void takeAddToHomeScreenScreenshot() throws UiObjectNotFoundException {
TestHelper.menuButton.perform(click());
assertTrue(TestHelper.AddtoHSmenuItem.waitForExists(waitingTime));
TestHelper.AddtoHSmenuItem.click();
assertTrue(TestHelper.AddtoHSCancelBtn.waitForExists(waitingTime));
Screengrab.screenshot("AddtoHSDialog");
TestHelper.AddtoHSCancelBtn.click();
Assert.assertTrue(TestHelper.browserURLbar.waitForExists(waitingTime));
}
示例5: takeScreenshotOfTabsTrayAndErase
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void takeScreenshotOfTabsTrayAndErase() throws Exception {
final UiObject mozillaImage = device.findObject(new UiSelector()
.resourceId("download")
.enabled(true));
UiObject imageMenuTitle = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/topPanel")
.enabled(true));
UiObject openNewTabTitle = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/design_menu_item_text")
.index(0)
.enabled(true));
UiObject multiTabBtn = device.findObject(new UiSelector()
.resourceId("org.mozilla.focus.debug:id/tabs")
.enabled(true));
UiObject eraseHistoryBtn = device.findObject(new UiSelector()
.text(getString(R.string.tabs_tray_action_erase))
.enabled(true));
Assert.assertTrue(mozillaImage.waitForExists(waitingTime));
mozillaImage.dragTo(mozillaImage, 7);
assertTrue(imageMenuTitle.waitForExists(waitingTime));
Assert.assertTrue(imageMenuTitle.exists());
Screengrab.screenshot("Image_Context_Menu");
//Open a new tab
openNewTabTitle.click();
assertTrue(multiTabBtn.waitForExists(waitingTime));
multiTabBtn.click();
assertTrue(eraseHistoryBtn.waitForExists(waitingTime));
Screengrab.screenshot("Multi_Tab_Menu");
eraseHistoryBtn.click();
device.wait(Until.findObject(By.res("org.mozilla.focus.debug", "snackbar_text")), waitingTime);
Screengrab.screenshot("YourBrowsingHistoryHasBeenErased");
}
示例6: takeScreenshotsOfFirstrun
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void takeScreenshotsOfFirstrun() throws UiObjectNotFoundException {
assertTrue(device.findObject(new UiSelector()
.text(getString(R.string.firstrun_defaultbrowser_title))
.enabled(true)
).waitForExists(waitingTime));
Screengrab.screenshot("Onboarding_1_View");
TestHelper.nextBtn.click();
assertTrue(device.findObject(new UiSelector()
.text(getString(R.string.firstrun_search_title))
.enabled(true)
).waitForExists(waitingTime));
Screengrab.screenshot("Onboarding_2_View");
TestHelper.nextBtn.click();
assertTrue(device.findObject(new UiSelector()
.text(getString(R.string.firstrun_shortcut_title))
.enabled(true)
).waitForExists(waitingTime));
Screengrab.screenshot("Onboarding_3_View");
TestHelper.nextBtn.click();
assertTrue(device.findObject(new UiSelector()
.text(getString(R.string.firstrun_privacy_title))
.enabled(true)
).waitForExists(waitingTime));
Screengrab.screenshot("Onboarding_last_View");
}
示例7: takeScreenshotsOfErrorPages
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void takeScreenshotsOfErrorPages() throws Exception {
for (ErrorTypes error: ErrorTypes.values()) {
onView(withId(R.id.urlView))
.check(matches(isDisplayed()))
.check(matches(hasFocus()))
.perform(click(), replaceText("error:" + error.value), pressImeActionButton());
assertTrue(TestHelper.webView.waitForExists(waitingTime));
assertTrue(TestHelper.progressBar.waitUntilGone(waitingTime));
// Android O has an issue with using Locator.ID
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
UiObject tryAgainBtn = device.findObject(new UiSelector()
.descriptionContains(getString(R.string.errorpage_refresh))
.clickable(true));
assertTrue(tryAgainBtn.waitForExists(waitingTime));
} else {
onWebView()
.withElement(findElement(Locator.ID, "errorTitle"))
.perform(webClick());
onWebView()
.withElement(findElement(Locator.ID, "errorTryAgain"))
.perform(webScrollIntoView());
}
Screengrab.screenshot(error.name());
onView(withId(R.id.display_url))
.check(matches(isDisplayed()))
.perform(click());
}
}
示例8: takeScreenshotOfHomeScreen
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void takeScreenshotOfHomeScreen() {
onView(withId(R.id.urlView))
.check(matches(isDisplayed()))
.check(matches(hasFocus()));
Screengrab.screenshot("Home_View");
}
示例9: takeScreenshotOfMenu
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void takeScreenshotOfMenu() {
TestHelper.menuButton.perform(click());
onView(withText(R.string.menu_whats_new))
.check(matches(isDisplayed()));
Screengrab.screenshot("MainViewMenu");
}
示例10: takeScreenshotOfNotification
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void takeScreenshotOfNotification() throws Exception {
onView(withId(R.id.urlView))
.check(matches(isDisplayed()))
.check(matches(hasFocus()))
.perform(click(), replaceText(webServer.url("/").toString()), pressImeActionButton());
onView(withId(R.id.display_url))
.check(matches(isDisplayed()))
.check(matches(withText(containsString(webServer.getHostName()))));
final UiObject openAction = device.findObject(new UiSelector()
.descriptionContains(getString(R.string.notification_action_open))
.resourceId("android:id/action0")
.enabled(true));
device.openNotification();
try {
if (!openAction.waitForExists(waitingTime)) {
// The notification is not expanded. Let's expand it now.
device.findObject(new UiSelector()
.text(getString(R.string.app_name)))
.swipeDown(20);
assertTrue(openAction.waitForExists(waitingTime));
}
Screengrab.screenshot("DeleteHistory_NotificationBar");
} finally {
// Close notification tray again
device.pressBack();
}
}
示例11: start
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void start(final Variant variant) throws InterruptedException {
final String name = variant.name().toLowerCase(US);
// Select the right variant.
onView(withId(R.id.menu_search_option)).perform(click());
onView(withText(variant.title)).perform(click());
// First text.
onView(withId(R.id.main_activity_emoji)).perform(click());
final int[] firstEmojis = new int[] { 0x1f913, 0x1F60E, 0x1F921, 0x1F920, 0x1F60F, 0x1F3BE };
onView(withId(R.id.main_activity_chat_bottom_message_edittext)).perform(append("Hello what's up? " + new String(firstEmojis, 0, firstEmojis.length)));
Thread.sleep(500); // Espresso does not synchronize it right away.
Screengrab.screenshot(name + "_1");
onView(withId(R.id.main_activity_send)).perform(click());
// Second text.
final int[] beerEmojis = new int[] { 0x1F37A, 0x1F37A, 0x1F37A };
onView(withId(R.id.main_activity_chat_bottom_message_edittext)).perform(append(new String(beerEmojis, 0, beerEmojis.length)));
onView(withId(R.id.main_activity_send)).perform(click());
final int[] clinkingBeerEmoji = new int[] { 0x1F37B };
onView(withId(R.id.main_activity_chat_bottom_message_edittext)).perform(append(new String(clinkingBeerEmoji, 0, clinkingBeerEmoji.length)));
onView(withId(R.id.main_activity_send)).perform(click());
Thread.sleep(500); // Espresso does not synchronize it right away.
Screengrab.screenshot(name + "_2");
// Third text.
onView(withId(R.id.main_activity_send)).perform(click());
final int[] secondEmojis = new int[] { 0x1F98B, 0x1F41E, 0x1F41D, 0x1F422, 0x1F432, 0x1F683, 0x1F37B, 0x1F943 };
onView(withId(R.id.main_activity_chat_bottom_message_edittext)).perform(append("I don't know " + new String(secondEmojis, 0, secondEmojis.length)));
Thread.sleep(500); // Espresso does not synchronize it right away.
Screengrab.screenshot(name + "_3");
}
示例12: takeScreenshot
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@TargetApi(27)
@Test
public void takeScreenshot() {
Screengrab.setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy());
Intent grouchyIntent = new Intent();
// intent stuff
grouchyIntent.putExtra(SSConstants.SS_QUARTERLY_INDEX_EXTRA, Locale.getDefault().getLanguage()+"-2018-01");
activityRule.launchActivity(grouchyIntent);
SystemClock.sleep(2000);
Screengrab.screenshot("lessons_screen");
}
示例13: testTakeScreenshot
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void testTakeScreenshot(){
Screengrab.screenshot("mainList");
// onView(withContentDescription(R.string.nav_drawer_open)).perform(click());
Screengrab.screenshot("drawerView");
//onView(withContentDescription(R.string.nav_drawer_close)).perform(click());
//onView(withId(R.id.add_item_main_list_view)).perform(click());
Screengrab.screenshot("productSelection");
}
示例14: splitActivityTest
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
@Test
public void splitActivityTest() {
Screengrab.screenshot("name_of_screenshot_here");
ViewInteraction appCompatButton = onView(
allOf(withId(R.id.next_button), withText("Seguinte"),
withParent(withId(R.id.layoutContainer)),
isDisplayed()));
appCompatButton.perform(click());
ViewInteraction appCompatTextView = onView(
allOf(withId(R.id.skip_text2), withText("Não me inscrever agora."), isDisplayed()));
appCompatTextView.perform(click());
ViewInteraction appCompatImageView = onView(
allOf(withId(R.id.search_button), withContentDescription("Search"),
withParent(allOf(withId(R.id.search_bar),
withParent(withId(R.id.searchView)))),
isDisplayed()));
appCompatImageView.perform(click());
ViewInteraction searchAutoComplete = onView(
allOf(withId(R.id.search_src_text),
withParent(allOf(withId(R.id.search_plate),
withParent(withId(R.id.search_edit_frame)))),
isDisplayed()));
searchAutoComplete.perform(replaceText("fundador"), closeSoftKeyboard());
ViewInteraction searchAutoComplete5 = onView(
allOf(withId(R.id.search_src_text), withText("fundador"),
withParent(allOf(withId(R.id.search_plate),
withParent(withId(R.id.search_edit_frame)))),
isDisplayed()));
searchAutoComplete5.perform(pressImeActionButton());
}
示例15: takeScreenshotsOfMenu
import tools.fastlane.screengrab.Screengrab; //导入方法依赖的package包/类
private void takeScreenshotsOfMenu() {
TestHelper.menuButton.perform(click());
Screengrab.screenshot("BrowserViewMenu");
}