Files
dolibarr/test/hurl/run.sh
Jon Bendtsen e8a347f89e NEW API for handling mass mailing targets (#35603)
* NEW API for handling mailing targets

* fix PHP Codesniffer

* adding return values to make phpstan happy

* Update function actually updates

* defining mailing_target public function create

* using a different language translation

* mailing_target - phpstan fixes

* mailing target - no check properties body

* mailing target int typecast fk_mailing

* mailing target - just 1 parameter

* mailing_target phpstan fixes

* mailing_target setting labelStatus

* mailing target class public function delete

* reveal the list of status name for the Mass mailing object in the API

* set tms to now when it is set to draft

* functions to set the mailing target status

* hurl testing api mailings

* hurl test - exit run script at first error

* hurl test mailings - should cover all endpoints

* using self:: in front of the CONST

* Trying to find out which line evaluates to noting

* API mailings can now get the targets of a mailing

* Protected method name "Mailings::_cleanTargetDatas" must not be prefixed with an underscore

* give me fk_project

* API endpoints for: Get all targets of a mass mailing + Get information about a specific target id

* API endpoint to update a mailing target

* telling pre-commit check to ignore, just like done in the function I copied

* be more explicit about for GUI tests we need username and password

* Prevent updating fk_mailing value

* API endpoint deleteTarget

* post to create a mailing target does work, but need slight more testing after work

* correct indent

* fixing some build errors

* More comprehensive hurl test of creation of a target

* adding status_dest to mailing targets json

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2025-10-09 18:38:13 +02:00

37 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
if [[ -z ${DOLIHOST+x} ]]; then
DOLIHOST="localhost"
fi
hostnport="${DOLIHOST}"
if [[ -z ${DOLIPORT+x} ]]; then
hostnport="${hostnport}:8080"
else
hostnport="${hostnport}:${DOLIPORT}"
fi
if [[ -z ${DOLISUBURL+x} ]]; then
DOLISUBURL=""
fi
if [[ "" != "${DOLISUBURL}" ]]; then
hostnport="${hostnport}/${DOLISUBURL}"
fi
echo "First we run tests that do not require authentication"
find api/ gui/ public/ -type f -iname '00*.hurl' -exec hurl --variable "hostnport=${hostnport}" --test "{}" + || exit 1
# Now we get ready to run tests that do require authentication
if [[ -z ${DOLAPIKEY+x} ]]; then
echo "DOLAPIKEY bash variable is unset, no API tests that require authentication"
else
echo "Now we are ready to run API tests that do require authentication"
find api/ -type f -iname '10*.hurl' -not -iname '00*.hurl' -exec hurl --variable "hostnport=${hostnport}" --header "${DOLAPIKEY}" --test "{}" + || exit 2
fi
./save_login_cookie.sh
if [[ -z ${COOKIEJAR+x} ]]; then
COOKIEJAR=/tmp/cookie.jar
fi
echo "Now we are ready to run GUI tests that do require authentication"
find gui/ -type f -iname '10*.hurl' -not -iname 'save_login_cookie.hurl' -not -iname '00*.hurl' -exec hurl --variable "hostnport=${hostnport}" --cookie "${COOKIEJAR}" --test "{}" + || exit 3
rm -rf "${COOKIEJAR}"