@Test public void test() { User<?> user = vk.getPart(User.class); user.goHome(); user.selectVideos(); Videos<?> videos = user.getPart(Videos.class); videos.enterSearchString("Selenium"); Assert.assertNotEquals(0, videos.getVideosCount()); videos.playVideo(0); }
/** * We launch VK and run test against desktop Firefox Also we attempt to check Android native * client */ @Before public void setUp() throws Exception { vk = desiredFactory.launch(appClass); loginPrerequisite(); /** * When here is Android we have to launch activity 'MainActivity' forcefully is it a bug of VK? */ if (AndroidApp.class.isAssignableFrom(vk.getClass())) { Thread.sleep(3000); ((AndroidApp) vk).startActivity("com.vkontakte.android", "MainActivity"); } }
@After public void tearDown() throws Exception { vk.quit(); }
private void loginPrerequisite() { VKLogin<?> vkLogin = vk.getPart(VKLogin.class); vkLogin.setLogin("*****@*****.**"); vkLogin.setPassword("ArachnidTester123"); vkLogin.enter(); }