Skip to content
Open

Test #220

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
36a48ba
Fixed typos in readme
dikshamalik2552 Apr 14, 2022
72e3b47
Merge pull request #186 from dikshamalik2552/master
wbrunette Apr 14, 2022
f437985
Merge pull request #202 from odk-x/master
r0ssing Apr 27, 2024
d6e1645
Updated package-lock.json to new npm format
r0ssing Apr 27, 2024
b40f131
Updated dependency that had low-severity ReDos regression
r0ssing Apr 27, 2024
848ea6e
Cleaned up old mercurial leftovers
r0ssing Apr 27, 2024
bf51a05
Added SQLite web assembly
r0ssing Apr 27, 2024
5c818a6
Updated README
r0ssing Apr 27, 2024
ff6f436
Updated doctypes in html files to simply <!doctype html> to avoid war…
r0ssing Apr 27, 2024
2e687ad
Fixed livereload issue
r0ssing Apr 27, 2024
199480a
Removing 'undefined' postfix from log when no detail provided
r0ssing Apr 27, 2024
4a4653e
Fixed raw javascript references
r0ssing Apr 27, 2024
5d0ccc4
Updated text to no longer specify Chrome browser requirement
r0ssing Apr 27, 2024
4eb0a47
Improved logging to use actual console log levels
r0ssing Apr 27, 2024
bad7ca3
Augmented log function to include caller info and removed severy prefix.
r0ssing Apr 27, 2024
33b388a
Fixed references
r0ssing Apr 27, 2024
460741d
Updated packages, livereload not working
r0ssing Apr 27, 2024
2c8de5a
Fixed livereload
r0ssing Apr 27, 2024
7251e94
Updated javascripts to support sqlite3
r0ssing Apr 28, 2024
6fc3e30
Updated tab1.html: Removed jquery-migrate, fixed purge button
r0ssing Apr 28, 2024
516265d
Commented out jquery-migrate in tab2-6
r0ssing Apr 28, 2024
9d20e77
Removed check for webDb
r0ssing Apr 28, 2024
4bfa000
Added ref. to sqlite3
r0ssing Apr 28, 2024
dfeaa92
Added favicon
r0ssing Apr 28, 2024
5439f3d
fixes firefox support
r0ssing Apr 28, 2024
e949e1c
Fixes empty string bug
r0ssing Apr 28, 2024
673eb17
Updated grunt config to add headers
r0ssing Apr 28, 2024
5bf5580
More header
r0ssing Apr 28, 2024
01bd03c
Newer doctype
r0ssing Apr 28, 2024
3a5fe4a
Replaced defect iframe with a link
r0ssing Apr 28, 2024
67ec5ab
Add min-height
r0ssing Apr 28, 2024
c6821f5
Fixing handlebars issue
r0ssing May 2, 2024
d76b8d9
Updated version
r0ssing May 9, 2024
a057626
Merge pull request #203 from HelloSapiens/development
r0ssing May 9, 2024
a485de2
fix pr #199
juayuohcarineneng19 May 18, 2024
ba380e0
Merge pull request #206 from odk-x/main
wbrunette May 22, 2024
9c69e7c
Merge pull request #205 from juayuohcarineneng19/fix-spawn-on-non-win…
wbrunette May 22, 2024
27ca2de
new logo update
juayuohcarineneng19 Jun 27, 2024
0ff0e54
ODK-X Logo width of 40%
juayuohcarineneng19 Jul 9, 2024
d46ef12
survey form title
juayuohcarineneng19 Jul 22, 2024
fa5a9ba
remove logo
juayuohcarineneng19 Jul 22, 2024
f759e6a
remove logo and modify Survey
juayuohcarineneng19 Jul 22, 2024
389cb82
reset
juayuohcarineneng19 Jul 25, 2024
ff70a72
Merge pull request #219 from odk-x/main
wbrunette Mar 5, 2025
f2285fb
Save to file system fix (#221)
Sphinx2071 Apr 7, 2025
2f3a9a5
Added exampleForm & Agriculture Form test using Playwright (#222)
sonalgaud12 Aug 6, 2025
518a867
Add CircleCI config for Playwright tests (#225)
sonalgaud12 Aug 14, 2025
833c0fc
Add Playwright test for XLSX Converter (#226)
sonalgaud12 Aug 22, 2025
8471ec5
Added test for datetimepicker (#227)
sonalgaud12 Aug 28, 2025
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
72 changes: 72 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
version: 2.1
jobs:
test:
docker:
- image: mcr.microsoft.com/playwright:v1.43.1-jammy
steps:
- checkout

- run:
name: Install system dependencies
command: apt-get update && apt-get install -y curl

- run:
name: Install dependencies
command: npm ci

- run:
name: Install Playwright Browsers
command: npx playwright install --with-deps

- run:
name: Start Grunt Server
background: true
command: |
npx grunt connect:livereload:keepalive

- run:
name: Wait for server to be ready
command: |
echo "Waiting for server to start..."
# Give the server a moment to initialize
sleep 3

for i in {1..30}; do
if curl -sSf http://localhost:8000 >/dev/null 2>&1; then
echo "Server is ready on port 8000!"
# Verify it's actually serving content
curl -s http://localhost:8000 | head -5
exit 0
fi
echo "Attempt $i/30: Server not ready yet..."
sleep 2
done

echo "Server failed to start after 60 seconds"
echo "Debug information:"
netstat -tlnp | grep :8000 || echo "No process listening on port 8000"
ps aux | grep grunt || echo "No grunt processes found"

# Check if grunt process exists but maybe on different port
ss -tlnp | grep :8000 || echo "No process listening on port 8000"
ps aux | grep grunt || echo "No grunt processes found"

# Check if grunt process exists but maybe on different port
ss -tlnp | grep grunt || echo "No grunt-related ports found"

exit 1

- run:
name: Run Playwright tests
command: npx playwright test
no_output_timeout: 10m

- store_artifacts:
path: test-results/
destination: playwright-test-results

workflows:
version: 2
test:
jobs:
- test
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ build/
app/output/props/*
tempZipDir
.idea/*
node_modules
node_modules

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
118 changes: 61 additions & 57 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ module.exports = function (grunt) {
},
macGenConvert: {
cmd: function(str, formDefFile) {
return 'node macGenConverter.js ' + str + ' > ' + formDefFile;
return 'node macGenConverter.js ' + str + ' > ' + formDefFile;
}
}
},
Expand Down Expand Up @@ -230,7 +230,7 @@ module.exports = function (grunt) {
connect: {
server: {
options: {
setHeaders: setHeaders
setHeaders: setHeaders
}
},
options: {
Expand All @@ -247,10 +247,10 @@ module.exports = function (grunt) {
next();
});

middlewares.unshift(postHandler);
middlewares.unshift(lrSnippet);
middlewares.unshift(mountFolder(baseDirForServer));
middlewares.unshift(mountDirectory(baseDirForServer));
middlewares.unshift(postHandler);
middlewares.unshift(lrSnippet);
return middlewares;
}
}
Expand All @@ -259,33 +259,37 @@ module.exports = function (grunt) {
options: {
port: 8001,
middleware: [
postHandler,
lrSnippet,
mountFolder('test'),
mountFolder(baseDirForServer),
mountDirectory(baseDirForServer)
]
}
mountFolder('test'),
mountFolder(baseDirForServer),
mountDirectory(baseDirForServer),
postHandler,
lrSnippet
]
}
}
},
open: {
open: {
server: {
path: 'http://localhost:<%= connect.options.port %>/index.html',
app: {app: (function() {
var platform = require('os').platform();
// windows: *win*
// mac: darwin
if (platform.search('win') >= 0 &&
platform.search('darwin') < 0) {
// Windows expects chrome.
grunt.log.writeln('detected Windows environment');
return 'chrome';
} else {
// Mac (and maybe others--add as discovered), expects
// Google Chrome
grunt.log.writeln('detected non-Windows environment');
return 'Google Chrome';
}
app: {
app: (function() {
var platform = require('os').platform();
// windows: *win*
// mac: darwin
// linux: linux
if (platform.search('win') !== -1) {
// Windows expects chrome.
grunt.log.writeln('Detected Windows environment');
return 'chrome';
} else if (platform.search('darwin') !== -1) {
// Mac expects "Google Chrome"
grunt.log.writeln('Detected macOS environment');
return 'Google Chrome';
} else {
// Default for Linux and potentially other environments
grunt.log.writeln('Detected non-Windows, non-macOS environment');
return 'google-chrome';
}
})()
}
}
Expand Down Expand Up @@ -365,15 +369,15 @@ module.exports = function (grunt) {
var platform = require('os').platform();
var isWindows = (platform.search('win') >= 0 &&
platform.search('darwin') < 0);

var dirs = grunt.file.expand(
{filter: function(path) {
if ( !path.endsWith(".xlsx") ) {
return false;
}
var cells = path.split((isWindows ? "\\" : "/"));
return (cells.length >= 6) &&
( cells[cells.length-1] === cells[cells.length-2] + ".xlsx" );
( cells[cells.length-1] === cells[cells.length-2] + ".xlsx" );
},
cwd: 'app' },
'**/*.xlsx',
Expand All @@ -396,30 +400,30 @@ module.exports = function (grunt) {
});

var zipAllFiles = function( destZipFile, filesList, completionFn ) {
// create a file to stream archive data to.
// create a file to stream archive data to.
var fs = require('fs');
var archiver = require('archiver');

var output = fs.createWriteStream(destZipFile);
var archive = archiver('zip', {
store: true // Sets the compression method to STORE.
store: true // Sets the compression method to STORE.
});
// listen for all archive data to be written

// listen for all archive data to be written
output.on('close', function() {
console.log(archive.pointer() + ' total bytes');
console.log('archiver has been finalized and the output file descriptor has closed.');
completionFn(true);
});
// good practice to catch this error explicitly

// good practice to catch this error explicitly
archive.on('error', function(err) {
throw err;
});
// pipe archive data to the file

// pipe archive data to the file
archive.pipe(output);

filesList.forEach(function(fileName) {
// Have to add app back into the file name for the adb push
var src = tablesConfig.appDir + '/' + fileName;
Expand All @@ -429,7 +433,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
grunt.log.writeln('error ' + err + ' adding ' + src + ' to file ' + destZipFile);
}} );
});
// finalize the archive (ie we are done appending files but streams have to finish yet)
// finalize the archive (ie we are done appending files but streams have to finish yet)
archive.finalize();
};

Expand All @@ -438,12 +442,12 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'BROKEN: does not compress and last file is not terminated properly. Construct the configzip and systemzip for survey and tables',
function() {
var done = this.async();

var buildDir = 'build' +
'/zips';

grunt.file.delete(buildDir + '/');

grunt.file.mkdir(buildDir);
grunt.file.mkdir(buildDir + '/survey/');
grunt.file.mkdir(buildDir + '/tables/');
Expand All @@ -465,7 +469,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/framework/**',
'config/assets/commonDefinitions.js',
'config/assets/img/play.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/backup.png',
'config/assets/img/advance.png',
'config/assets/css/odk-survey.css',
Expand Down Expand Up @@ -493,16 +497,16 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'!**/.DS_Store',
'!**/~$*.xlsx');

zipAllFiles(buildDir + '/survey/systemzip', surveySystemZipFiles,
zipAllFiles(buildDir + '/survey/systemzip', surveySystemZipFiles,
function(outcome) {
if ( outcome ) {
zipAllFiles(buildDir + '/survey/configzip', surveyConfigZipFiles,
zipAllFiles(buildDir + '/survey/configzip', surveyConfigZipFiles,
function(outcome) {
if ( outcome ) {
zipAllFiles(buildDir + '/tables/systemzip', tablesSystemZipFiles,
zipAllFiles(buildDir + '/tables/systemzip', tablesSystemZipFiles,
function(outcome) {
if ( outcome ) {
zipAllFiles(buildDir + '/tables/configzip', tablesConfigZipFiles,
zipAllFiles(buildDir + '/tables/configzip', tablesConfigZipFiles,
function(outcome) {
if ( outcome ) {
grunt.log.writeln('success!');
Expand Down Expand Up @@ -816,15 +820,15 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
destFileName = destFileName.substring(0,idx) + destFileName.substring(idx+demoInfix.length);
idx = destFileName.indexOf(demoInfix + ".");
}

var idxDir = destFileName.indexOf(demoInfix + "/");
while ( idxDir >= 0 ) {
// directory...
isInfixed = true;
destFileName = destFileName.substring(0,idxDir) + destFileName.substring(idxDir+demoInfix.length);
idxDir = destFileName.indexOf(demoInfix + "/");
}

var buildDir = 'build' +
'/' +
demoInfix.substring(1);
Expand Down Expand Up @@ -858,7 +862,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {

//
// returns a function that will handle the adb push of files onto the
// device with any files containing ".infix." stripped of that infix
// device with any files containing ".infix." stripped of that infix
// and any folders ending in ".infix" also stripped.
//
var infixRenameAdbPusher = function(demoInfix, offsetDir) {
Expand All @@ -884,7 +888,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
destFileName = destFileName.substring(0,idx) + destFileName.substring(idx+demoInfix.length);
idx = destFileName.indexOf(demoInfix + ".");
}

var idxDir = destFileName.indexOf(demoInfix + "/");
while ( idxDir >= 0 ) {
// directory...
Expand Down Expand Up @@ -1063,7 +1067,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/css/odk-survey.css',
'config/assets/img/advance.png',
'config/assets/img/backup.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/little_arrow.png',
'config/assets/img/play.png',
'config/assets/libs/**',
Expand Down Expand Up @@ -1137,7 +1141,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/css/odk-survey.css',
'config/assets/img/advance.png',
'config/assets/img/backup.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/little_arrow.png',
'config/assets/img/play.png',
'config/assets/libs/**',
Expand Down Expand Up @@ -1216,7 +1220,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/css/odk-survey.css',
'config/assets/img/advance.png',
'config/assets/img/backup.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/little_arrow.png',
'config/assets/img/play.png',
'config/assets/libs/**',
Expand Down Expand Up @@ -1306,7 +1310,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/css/odk-survey.css',
'config/assets/img/advance.png',
'config/assets/img/backup.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/little_arrow.png',
'config/assets/img/play.png',
'config/assets/libs/**',
Expand Down Expand Up @@ -1468,7 +1472,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
'config/assets/css/odk-survey.css',
'config/assets/img/advance.png',
'config/assets/img/backup.png',
'config/assets/img/form_logo.png',
'config/assets/img/form_logo_new.png',
'config/assets/img/little_arrow.png',
'config/assets/img/play.png',
'config/assets/libs/**',
Expand Down Expand Up @@ -1858,7 +1862,7 @@ var zipAllFiles = function( destZipFile, filesList, completionFn ) {
// to /sdcard/odk/forms
// I.e., this folder should contain things like:
// .../formid.xml
// .../formid-media/form_logo.jpg
// .../formid-media/form_logo_new.jpg
// .../formid-media/...
// .../formid2.xml
//
Expand Down
5 changes: 4 additions & 1 deletion app/config/assets/css/odk-survey.css
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@ Eventually we should make a jqm theme for this.
}

.odk-formlogo {
width: 100%;
width: 40%;
height: 40%;
}

.odk-label-image {
width: 100%;
}
Expand Down Expand Up @@ -679,3 +681,4 @@ Eventually we should make a jqm theme for this.
overflow:hidden;
margin-right:50px;
}

Loading