Search in sources :

Example 1 with Category

use of org.junit.experimental.categories.Category in project android by owncloud.

the class PasscodeTestSuite method testPincodeEnable.

@Test
@Category({ NoIgnoreTestCategory.class })
public void testPincodeEnable() throws Exception {
    driver.rotate(ScreenOrientation.PORTRAIT);
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    MenuList menu = fileListView.clickOnMenuButton();
    SettingsView settingsView = menu.clickOnSettingsButton();
    PassCodeView passCodeview = settingsView.EnablePassCode();
    PassCodeView passCodeview2 = passCodeview.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    passCodeview2.reenterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
    //TO DO. Open the app instead of start an activity
    driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
    //here we check that we are not in the fileDisplayActivity,
    //because pincode is asked
    common.assertIsNotInFileListView();
    common.assertIsPasscodeRequestView();
    PassCodeRequestView passCodeReequestView = new PassCodeRequestView(driver);
    passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    common.assertIsInFileListView();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) MenuList(com.owncloud.android.test.ui.models.MenuList) PassCodeView(com.owncloud.android.test.ui.models.PassCodeView) PassCodeRequestView(com.owncloud.android.test.ui.models.PassCodeRequestView) SettingsView(com.owncloud.android.test.ui.models.SettingsView) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 2 with Category

use of org.junit.experimental.categories.Category in project android by owncloud.

the class RefreshFolderTestSuite method testPulldownToRefreshFolder.

@Test
@Category({ UnfinishedTestCategory.class })
public void testPulldownToRefreshFolder() throws Exception {
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    //TODO. Remove the sleep and check why is not working the assert 
    //when using waitTillElementIsNotPresent
    Thread.sleep(5000);
    //waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
    fileListView.pulldownToRefresh();
    assertTrue(fileListView.getProgressCircular().isDisplayed());
//TODO insert a file in the web, and check that it's shown here
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) Category(org.junit.experimental.categories.Category) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) Test(org.junit.Test)

Example 3 with Category

use of org.junit.experimental.categories.Category in project android by owncloud.

the class RenameFolderTestSuite method testRenameFolder.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testRenameFolder() throws Exception {
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    //TODO. if the folder already exists, do no created
    //create the folder to rename
    WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(OLD_FOLDER_NAME, fileListView);
    Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
    fileListView.scrollTillFindElement(OLD_FOLDER_NAME);
    assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
    //check if the folder with the new name already exists 
    //and if true, delete them
    Actions.deleteElement(FOLDER_NAME, fileListView, driver);
    CurrentCreatedFolder = OLD_FOLDER_NAME;
    ElementMenuOptions menuOptions = fileListView.longPressOnElement(OLD_FOLDER_NAME);
    NewFolderPopUp FolderPopUp = menuOptions.clickOnRename();
    FolderPopUp.typeNewFolderName(FOLDER_NAME);
    FolderPopUp.clickOnNewFolderOkButton();
    CurrentCreatedFolder = FOLDER_NAME;
    Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
    fileListView.scrollTillFindElement(FOLDER_NAME);
    assertNotNull(fileListView.getFileElement());
    assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
    assertEquals(FOLDER_NAME, fileListView.getFileElement().getText());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) NewFolderPopUp(com.owncloud.android.test.ui.models.NewFolderPopUp) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) Category(org.junit.experimental.categories.Category) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 4 with Category

use of org.junit.experimental.categories.Category in project android by owncloud.

the class ShareLinkFileTestSuite method testUnshareLinkFile.

@Test
@Category({ IgnoreTestCategory.class, SmokeTestCategory.class })
public void testUnshareLinkFile() throws Exception {
    AndroidElement sharedElementIndicator;
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    //TODO. if the file already exists, do not upload
    FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
    fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
    assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
    sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, fileListViewAfterUploadFile, driver, common);
    assertTrue(sharedElementIndicator.isDisplayed());
    Actions.unshareLinkElement(FILE_NAME, fileListViewAfterUploadFile, driver, common);
    assertFalse(sharedElementIndicator.isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) AndroidElement(io.appium.java_client.android.AndroidElement) Category(org.junit.experimental.categories.Category) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) IgnoreTestCategory(com.owncloud.android.test.ui.groups.IgnoreTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 5 with Category

use of org.junit.experimental.categories.Category in project android by owncloud.

the class ShareLinkFileTestSuite method testShareLinkFileByCopyLink.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testShareLinkFileByCopyLink() throws Exception {
    AndroidElement sharedElementIndicator;
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    //TODO. if the file already exists, do not upload
    FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
    fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
    assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
    sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, fileListViewAfterUploadFile, driver, common);
    assertTrue(sharedElementIndicator.isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) AndroidElement(io.appium.java_client.android.AndroidElement) Category(org.junit.experimental.categories.Category) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) IgnoreTestCategory(com.owncloud.android.test.ui.groups.IgnoreTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Aggregations

Category (org.junit.experimental.categories.Category)900 Test (org.junit.Test)856 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)148 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)121 File (java.io.File)102 Instant (org.joda.time.Instant)92 KV (org.apache.beam.sdk.values.KV)86 ArrayList (java.util.ArrayList)84 Row (org.apache.beam.sdk.values.Row)71 Schema (org.apache.beam.sdk.schemas.Schema)65 VM (org.apache.geode.test.dunit.VM)65 QuickTest (com.hazelcast.test.annotation.QuickTest)57 List (java.util.List)57 Matchers.containsString (org.hamcrest.Matchers.containsString)55 InputStream (java.io.InputStream)49 NightlyTest (com.hazelcast.test.annotation.NightlyTest)47 FileListView (com.owncloud.android.test.ui.models.FileListView)46 UsesSchema (org.apache.beam.sdk.testing.UsesSchema)43 StringUtils.byteArrayToJsonString (org.apache.beam.sdk.util.StringUtils.byteArrayToJsonString)41 IOException (java.io.IOException)40