This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push: new 1ffeb7d93c Tests: use Playwright for JS browser testing (instead of trying to detect the user's installed browsers) 1ffeb7d93c is described below commit 1ffeb7d93c962495ac786952adae0ba8b011798f Author: Josh Tynjala <joshtynj...@apache.org> AuthorDate: Mon Aug 1 16:13:52 2022 -0700 Tests: use Playwright for JS browser testing (instead of trying to detect the user's installed browsers) This should be more reliable and less intrusive because the browsers run headless --- .../js/projects/BasicJS/src/test/royale/build.xml | 83 +++++----------------- .../projects/BindingJS/src/test/royale/build.xml | 83 +++++----------------- .../CollectionsJS/src/test/royale/build.xml | 83 +++++----------------- .../js/projects/CoreJS/src/test/royale/build.xml | 83 +++++----------------- .../MXRoyaleBaseJS/src/test/royale/build.xml | 83 +++++----------------- .../projects/NetworkJS/src/test/royale/build.xml | 83 +++++----------------- .../ReflectionJS/src/test/royale/build.xml | 83 +++++----------------- .../RoyaleUnitJS/src/test/royale/build.xml | 83 +++++----------------- .../js/projects/XMLJS/src/test/royale/build.xml | 83 +++++----------------- 9 files changed, 144 insertions(+), 603 deletions(-) diff --git a/frameworks/js/projects/BasicJS/src/test/royale/build.xml b/frameworks/js/projects/BasicJS/src/test/royale/build.xml index ac88463c7e..10ffcc0c22 100644 --- a/frameworks/js/projects/BasicJS/src/test/royale/build.xml +++ b/frameworks/js/projects/BasicJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="BasicJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/BindingJS/src/test/royale/build.xml b/frameworks/js/projects/BindingJS/src/test/royale/build.xml index 8af13a6689..f104320c04 100644 --- a/frameworks/js/projects/BindingJS/src/test/royale/build.xml +++ b/frameworks/js/projects/BindingJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="BindingJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -158,18 +102,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -181,6 +128,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -212,6 +160,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/CollectionsJS/src/test/royale/build.xml b/frameworks/js/projects/CollectionsJS/src/test/royale/build.xml index a3aff51fc6..24c754c62e 100644 --- a/frameworks/js/projects/CollectionsJS/src/test/royale/build.xml +++ b/frameworks/js/projects/CollectionsJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="CoreJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/CoreJS/src/test/royale/build.xml b/frameworks/js/projects/CoreJS/src/test/royale/build.xml index ab08c2bef7..47bf4d9cf0 100644 --- a/frameworks/js/projects/CoreJS/src/test/royale/build.xml +++ b/frameworks/js/projects/CoreJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="CoreJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/MXRoyaleBaseJS/src/test/royale/build.xml b/frameworks/js/projects/MXRoyaleBaseJS/src/test/royale/build.xml index 319a6db33d..d1c4ac23f4 100644 --- a/frameworks/js/projects/MXRoyaleBaseJS/src/test/royale/build.xml +++ b/frameworks/js/projects/MXRoyaleBaseJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="MXRoyaleBaseJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -160,18 +104,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -183,6 +130,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -207,6 +155,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/NetworkJS/src/test/royale/build.xml b/frameworks/js/projects/NetworkJS/src/test/royale/build.xml index 5bea5f9404..6a31289f97 100644 --- a/frameworks/js/projects/NetworkJS/src/test/royale/build.xml +++ b/frameworks/js/projects/NetworkJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="NetworkJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/ReflectionJS/src/test/royale/build.xml b/frameworks/js/projects/ReflectionJS/src/test/royale/build.xml index 14b4183cfd..9188163efd 100644 --- a/frameworks/js/projects/ReflectionJS/src/test/royale/build.xml +++ b/frameworks/js/projects/ReflectionJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="ReflectionJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml b/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml index eedbc32937..9a0cb6fa7c 100644 --- a/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml +++ b/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="RoyaleUnitJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -162,18 +106,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -185,6 +132,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -209,6 +157,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" diff --git a/frameworks/js/projects/XMLJS/src/test/royale/build.xml b/frameworks/js/projects/XMLJS/src/test/royale/build.xml index 4fec7ae2f0..876e6c2c98 100644 --- a/frameworks/js/projects/XMLJS/src/test/royale/build.xml +++ b/frameworks/js/projects/XMLJS/src/test/royale/build.xml @@ -30,65 +30,9 @@ <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> <property name="target.name" value="XMLJS-${release.version}.swc" /> - <!-- - Windows browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use internet explorer! it cannot run scripts in local pages - --> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Google/Chrome/Application/chrome.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - <condition property="royaleunit.browser" value="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"> - <and> - <os family="windows"/> - <available file="${env.ProgramFiles(x86)}/Mozilla Firefox/firefox.exe"/> - </and> - </condition> - - <!-- - macOS browser: - try chrome first because it's the most popular browser - otherwise, try to fall back to firefox - DON'T use safari! it asks the user to confirm opening local pages - --> - <condition property="royaleunit.browser" value="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"> - <and> - <os family="mac"/> - <available file="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> - </and> - </condition> - <condition property="royaleunit.browser" value="/Applications/Firefox.app/Contents/MacOS/firefox"> - <and> - <os family="mac"/> - <available file="/Applications/Firefox.app/Contents/MacOS/firefox"/> - </and> - </condition> - - <!-- - Linux/Unix browser - --> - <condition property="royaleunit.browser" value="/usr/bin/firefox"> - <and> - <os family="unix"/> - <available file="/usr/bin/firefox"/> - </and> - </condition> + <!-- if not set already, default to an empty string to use Playwright --> + <property name="royaleunit.browser" value=""/> + <property name="royaleunit.browser.args" value=""/> <property name="report.dir" value="${basedir}/out" /> @@ -157,18 +101,21 @@ if the royaleunit.browser property was provided manually, check if the file actually exists --> - <condition property="royaleunit.browser.exists"> - <and> - <isset property="royaleunit.browser" /> - <available file="${royaleunit.browser}" type="file" /> - </and> + <condition property="royaleunit.browser.valid"> + <or> + <!-- allow an empty string because it'll use Playwright in that case --> + <equals arg1="${royaleunit.browser}" arg2="" /> + <and> + <isset property="royaleunit.browser" /> + <available file="${royaleunit.browser}" type="file" /> + </and> + </or> </condition> - - <fail unless="royaleunit.browser.exists" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> + <fail unless="royaleunit.browser.valid" message="Invalid royaleunit.browser path: "${royaleunit.browser}". To skip RoyaleUnit tests, use -Dskip-tests." /> </target> <target name="test" depends="check-royaleunit-browser" - if="royaleunit.browser.exists" unless="skip-tests" + unless="skip-tests" xmlns:if="ant:if" xmlns:unless="ant:unless"> <macrodef name="debug.test"> @@ -180,6 +127,7 @@ player="html" swf="${basedir}/target/bin/js-debug/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false" @@ -204,6 +152,7 @@ player="html" swf="${basedir}/target/bin/js-release/index.html" command="${royaleunit.browser}" + commandArgs="${royaleunit.browser.args}" workingDir="${basedir}" toDir="${report.dir}" haltonfailure="false"