Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#TESTAR v2.8.6 (24-Mar-2026)
- Remove linux AtSpi subproject
- Remove unused Tags
- Refactor custom interfaces with Java functions
- Refactor ProtocolUtil and add ScreenshotProvider


#TESTAR v2.8.5 (17-Mar-2026)
- Bump io.appium:java-client from 10.0.0 to 10.1.0
- Update JS getIsBlockedTestar logic
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.5
2.8.6
156 changes: 0 additions & 156 deletions android/src/org/testar/monkey/alayer/android/AndroidProtocolUtil.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.testar.monkey.alayer.exceptions.StateBuildException;
import org.testar.monkey.alayer.android.enums.AndroidTags;
import org.testar.monkey.alayer.android.util.AndroidNodeParser;
import org.testar.monkey.alayer.android.util.AndroidXpathUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

Expand Down Expand Up @@ -82,7 +83,7 @@ public AndroidState call() throws Exception {
// After create the widget tree, set widgets Path
for (Widget w : root) {
w.set(Tags.Path, Util.indexString(w));
w.set(AndroidTags.AndroidXpath, AndroidProtocolUtil.constructXpath(w));
w.set(AndroidTags.AndroidXpath, AndroidXpathUtil.constructXpath(w));
}

return root;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***************************************************************************************************
*
* Copyright (c) 2020 - 2025 Open Universiteit - www.ou.nl
* Copyright (c) 2020 - 2025 Universitat Politecnica de Valencia - www.upv.es
* Copyright (c) 2020 - 2026 Open Universiteit - www.ou.nl
* Copyright (c) 2020 - 2026 Universitat Politecnica de Valencia - www.upv.es
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -32,7 +32,7 @@

import org.testar.monkey.alayer.Action;
import org.testar.monkey.alayer.State;
import org.testar.monkey.alayer.android.AndroidProtocolUtil;
import org.testar.monkey.alayer.android.util.AndroidScreenshotUtil;

import javax.swing.*;
import java.awt.event.ActionEvent;
Expand Down Expand Up @@ -138,7 +138,7 @@ public void actionPerformed(ActionEvent actionEvent) {
/** Method called when the overlay needs to be updated when the state changes. */
private void updateScreen() {
// Updates screenshot and overlay
String screenshotPath = AndroidProtocolUtil.getStateshotSpyMode(usedState);
String screenshotPath = AndroidScreenshotUtil.getStateshotSpyMode(usedState);
imagePanel.updateSc(screenshotPath, treeVizInstance.tree, deriveActionsFunction.apply(usedState));

frame.revalidate();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/***************************************************************************************************
*
* Copyright (c) 2020 - 2026 Universitat Politecnica de Valencia - www.upv.es
* Copyright (c) 2020 - 2026 Open Universiteit - www.ou.nl
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************************************/

package org.testar.monkey.alayer.android.util;

import java.io.IOException;
import java.util.Objects;

import org.testar.monkey.alayer.AWTCanvas;
import org.testar.monkey.alayer.Action;
import org.testar.monkey.alayer.State;
import org.testar.monkey.alayer.Tags;
import org.testar.monkey.alayer.android.AndroidAppiumFramework;
import org.testar.util.ScreenshotUtil;

public class AndroidScreenshotUtil {

private AndroidScreenshotUtil() {
}

public static String getActionshot(State state, Action action) {
Objects.requireNonNull(state, "State cannot be null");
Objects.requireNonNull(action, "Action cannot be null");
try {
return AndroidAppiumFramework.getScreenshotAction(state, action);
} catch(Exception e) {
System.err.println("Exception when taking action screenshot: " + e);
}

return "";
}

public static String getStateshotSpyMode(State state) {
Objects.requireNonNull(state, "State cannot be null");
try {
return AndroidAppiumFramework.getScreenshotSpyMode(state.get(Tags.ConcreteID, "NoConcreteIdAvailable"));
} catch(Exception e) {
System.err.println("Exception occured when trying to take a screenshot of the Android emulator: " + e);
}

return "";
}

/**
* Method returns a binary representation of a state's screenshot.
* @param state
* @return
*/
public static AWTCanvas getStateshotBinary(State state) {
Objects.requireNonNull(state, "State cannot be null");
try {
return AndroidAppiumFramework.getScreenshotBinary(state);
} catch (IOException e) {
System.err.println("Exception occured when trying to take a binary screenshot of the Android emulator: " + e);
}

return ScreenshotUtil.getStateshotBinary(state);
}

}
Loading
Loading