End to end tests
This commit is contained in:
parent
c71e4b4cd0
commit
fed82d1ae8
26 changed files with 1016 additions and 37 deletions
|
|
@ -39,6 +39,19 @@ try {
|
|||
'token' => $token
|
||||
));
|
||||
$result = faceai_fetch_json($bridgeUrl);
|
||||
$matches = is_array($result['matches'] ?? null) ? $result['matches'] : array();
|
||||
$photos = array_map(static function ($match) {
|
||||
$photoId = (string) ($match['photoId'] ?? ($match['id'] ?? ''));
|
||||
|
||||
return array(
|
||||
'id' => $photoId,
|
||||
'photoId' => $photoId,
|
||||
'label' => (string) ($match['label'] ?? $photoId),
|
||||
'checkpoint' => (string) ($match['checkpoint'] ?? '-'),
|
||||
'previewUrl' => (string) ($match['previewUrl'] ?? ''),
|
||||
'score' => $match['score'] ?? null,
|
||||
);
|
||||
}, $matches);
|
||||
|
||||
faceai_sim_render_page(array(
|
||||
'raceId' => (string) ($result['raceId'] ?? ($payload['raceId'] ?? '')),
|
||||
|
|
@ -46,9 +59,9 @@ try {
|
|||
'raceSlug' => (string) ($result['raceId'] ?? ($payload['raceId'] ?? '')),
|
||||
'raceName' => (string) ($result['raceName'] ?? ('Race ' . ($payload['raceId'] ?? ''))),
|
||||
'returnUrl' => (string) ($result['returnUrl'] ?? 'faceai_simulator.php'),
|
||||
'banner' => 'Vista filtrata da FaceAI. Sono state trovate <strong>' . count($result['matches'] ?? array()) . '</strong> foto corrispondenti per l utente corrente.',
|
||||
'totalLabel' => count($result['matches'] ?? array()) . ' foto da FaceAI',
|
||||
'photos' => is_array($result['matches'] ?? null) ? $result['matches'] : array(),
|
||||
'banner' => 'Vista filtrata da FaceAI. Sono state trovate <strong>' . count($photos) . '</strong> foto corrispondenti per l utente corrente.',
|
||||
'totalLabel' => count($photos) . ' foto da FaceAI',
|
||||
'photos' => $photos,
|
||||
'showSimulatorBootstrap' => false
|
||||
));
|
||||
} catch (Throwable $error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue