Skip to content

Commit

Permalink
Fix visibility problem for tests
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Nov 8, 2023
1 parent 15e015b commit d1c681b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import android.app.Activity
import androidx.test.espresso.Espresso
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.NavigationViewActions
Expand Down Expand Up @@ -238,12 +240,15 @@ class FileDisplayActivityIT : AbstractOnServerIT() {
onView(withId(R.id.sort_button)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))

// browse into folder
onView(withId(R.id.list_root)).perform(
RecyclerViewActions.actionOnItemAtPosition<OCFileListItemViewHolder>(
0,
click()
onView(withId(R.id.list_root))
.perform(scrollTo())
.perform(closeSoftKeyboard())
.perform(
RecyclerViewActions.actionOnItemAtPosition<OCFileListItemViewHolder>(
0,
click()
)
)
)
shortSleep()
checkToolbarTitle(topFolder)
// sort button should now be visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,15 @@ public static void deleteAllFilesOnServer() {

if (!remoteFile.getRemotePath().equals("/")) {
if (remoteFile.isEncrypted()) {
assertTrue(new ToggleEncryptionRemoteOperation(remoteFile.getLocalId(),
remoteFile.getRemotePath(),
false)
.execute(client)
.isSuccess());
ToggleEncryptionRemoteOperation operation = new ToggleEncryptionRemoteOperation(remoteFile.getLocalId(),
remoteFile.getRemotePath(),
false);

boolean operationResult = operation
.execute(client)
.isSuccess();

assertTrue(operationResult);
}

boolean removeResult = false;
Expand Down

0 comments on commit d1c681b

Please sign in to comment.