---
sourceDocument: Yokohama Créer ou modifier des applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/yokohama/application-development

 Release :

    - yokohama

ft:locale :

    - fr-FR

ft:publication_title :

    - Yokohama Créer ou modifier des applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Creator


---

Framework de tests automatisés API de test : ServiceNow Fluent
==============================================================

Framework de tests automatisés API de test : ServiceNow Fluent {#ariaid-title1}
===============================================================================

* Rversion finale: Yokohama
* 
* Mis à jour 30 janv. 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes de lecture

L'API de test inclut des objets qui créent et exécutent des tests automatisés \[sys_atf_test\] pour confirmer que votre instance fonctionne après avoir effectué un changement.  
Remarque :  
L'API Framework de tests automatisés de test ne prend en charge que la synchronisation unidirectionnelle. Après la définition d'un test ATF dans le code source, si les métadonnées sont modifiées en dehors du code source, ces modifications ne sont pas synchronisées et reflétées dans le code source.

Objet de test {#ariaid-title2}
------------------------------

Créez un test automatisé \[sys_atf_test\] contenant une série d'étapes à exécuter.
{#atf-test-object-now-ts__table_vy2_525_jq__entry__3}

|          Nom          |       Type       |                                                                                                                                                                                          Description                                                                                                                                                                                          |
|-----------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| $id                   | Chaîne ou numéro | Requis. ID unique pour l'objet de métadonnées fourni au format suivant, où `< valeur >` est une chaîne ou un numéro. $id: Now.ID[<value>] Lorsque vous créez l'application, cet ID est haché en une sys_ID unique.                                                                                                                                                                            |
| nom                   | Chaîne           | Nom unique pour le test.                                                                                                                                                                                                                                                                                                                                                                      |
| description           | Chaîne           | Description de la fonction du test.                                                                                                                                                                                                                                                                                                                                                           |
| actif                 | Booléen          | Marqueur indiquant si le test est actif. Valeurs valides : * vrai : le test est actif. * faux : le test n'est pas actif. {#atf-test-object-now-ts__ul_cxj_srr_4bc} Par défaut : true                                                                                                                                                                                                          |
| failOnServerError     | Booléen          | Marqueur indiquant s'il faut échouer lorsqu'une erreur du serveur se produit pendant le test. Valeurs valides : * vrai : le test échoue lorsqu'une erreur du serveur se produit. * false : le test n'échoue pas lorsqu'une erreur du serveur se produit. {#atf-test-object-now-ts__ul_sc1_5w2_ybc} Par défaut : true                                                                          |
| ConfigurationFunction | Fonction         | Les étapes du test. Les étapes de test sont transmises sous forme d'instructions dans la fonction atf . (atf) => { atf.form.openNewForm({ table: 'sn_example_table', formUI: 'standard_ui', view: '', }) } Pour plus d'informations sur les étapes de test, reportez-vous à la section [Étapes de test prises en charge](https://servicenow-prod.fluidtopics.net/ZYKsY7De6dN3clFEz7YeAA#atf-test-object-now-ts__section_q5c_qmp_ccc). |
[Tableau 1. Propriétés]

{#atf-test-object-now-ts__table_vy2_525_jq}  
Les valeurs de sortie des étapes de test avec des variables de sortie peuvent être enregistrées en tant que variables et utilisées comme entrées dans d'autres étapes à l'aide de la syntaxe `output.<output-variable>`. Les variables de sortie peuvent être utilisées à la fois directement comme entrées sur les champs appropriés ou à l'intérieur d'une chaîne de modèle, comme avec `atf.server.log` dans l'exemple suivant.  

    import { Test } from '@servicenow/sdk/core'
    import '@servicenow/sdk-core/global'

    Test(
        {
            active: true,
            failOnServerError: true,
            name: 'Simple example',
            description: 'An illustrative test written in fluent',
            $id: Now.ID[1],
        },
        (atf) => {
            atf.form.openNewForm({
                table: 'sn_table_app_reptile_table',
                formUI: 'standard_ui',
                view: '',
            })
            atf.form.setFieldValue({
                table: 'sn_table_app_reptile_table',
                formUI: 'standard_ui',
                fieldValues: {
                    reptiles: 'lizard' as any,
                },
            })
            const output = atf.form.submitForm({ assertType: 'form_submitted_to_server', formUI: 'standard_ui' })
            atf.server.recordValidation({
                recordId: output.record_id,
                table: 'sn_table_app_reptile_table',
                assertType: 'record_validated',
                enforceSecurity: true,
                fieldValues: 'reptiles=lizard',
            })
            atf.server.log({
                log: `Submitted record with sys_id: ${output.record_id} to table ${output.table}`
            })
        }
    )

### Étapes de test prises en charge {#atf-test-object-now-ts__section_q5c_qmp_ccc}

Les étapes de test suivantes sont prises en charge. Pour en savoir plus sur les propriétés de l'étape, consultez la [Framework de tests automatisés Catégories d'étapes de test (ATF)](https://servicenow-prod.fluidtopics.net/Sc9uvSWOBtGyWyWmb7MGBg "Recherchez les étapes de test pour une interface utilisateur ou Now Platform une fonctionnalité particulière.") documentation.  
Remarque :  
Certains champs disponibles pour les étapes de test sur les formulaires ne sont pas disponibles en tant que propriétés dans ServiceNow Fluent.
{#atf-test-object-now-ts__table_uqw_2mp_ccc__entry__2}

|                                                                                                                        Catégorie                                                                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                        Étapes                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Catégorie Navigateur d'application](https://servicenow-prod.fluidtopics.net/zc0Cj_H2uKWeGUDXCEmKJg#test-steps-app-navigator-category "Vérifiez la fonctionnalité des menus et modules dans le navigateur d’applications.")                                                                      | * atf.applicationNavigator.moduleVisibility * atf.applicationNavigator.navigateToModule * atf.applicationNavigator.applicationMenuVisibility {#atf-test-object-now-ts__ul_dxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Catégorie d'e-mail](https://servicenow-prod.fluidtopics.net/DHEHvELNpaL1Kh27FYHgtw#test-steps-email-category "Utilisez Framework de tests automatisés (ATF) pour tester les notifications par e-mail, les flux d’e-mails sortants et les réponses aux e-mails entrants.")                       | * atf.email.validateOutboundEmailGeneratedByNotification * atf.email.generateRandomString * atf.email.generateInboundReplyEmail * atf.email.validateOutboundEmailGeneratedByFlow * atf.email.generateInboundEmail * atf.email.validateOutboundEmail {#atf-test-object-now-ts__ul_exm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Formulaires dans la Portail de services catégorie](https://servicenow-prod.fluidtopics.net/4UWwD~lgnjLh0tKPkI_JQg#test-steps-forms-portal-category "Validez la fonctionnalité des champs et des actions d’interface utilisateur dans les Portail de services widgets de formulaire.")           | * atf.form_SP.openForm_SP * atf.form_SP. openServicePortalPage * atf.form_SP.setFieldValue_SP * atf.form_SP. fieldValueValidation_SP * atf.form_SP.fieldStateValidation_SP * atf.form_SP.uiActionVisibilityValidation_SP * atf.form_SP.cliquezUIAction_SP * atf.form_SP.submitForm_SP {#atf-test-object-now-ts__ul_fxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Service Catalog dans la catégorie Service Portal](https://servicenow-prod.fluidtopics.net/4l7KLAjeHF_k2_yg~voP8A#test-steps-catalog-portal-category "Validez les transactions d’éléments de catalogue et les flux des demandeurs à partir de Portail de services.")                             | * atf.catalog_SP.openRecordProducer_SP * atf.catalog_SP.openOrderGuide_SP * atf.catalog_SP.openCatalogItem_SP * atf.catalog_SP.saveCurrentRowOfMultiRowVariableSet_SP * atf.catalog_SP.addRowToMultiRowVariableSet_SP * atf.catalog_SP.setVariableValue_SP * atf.catalog_SP.validateVariableValue_SP * atf.catalog_SP.variableStateValidation_SP * atf.catalog_SP.validatePriceAndRecurringPrice_SP * atf.catalog_SP.navigatewithinOrderGuide_SP * atf.catalog_SP.setCatalogItemQuantity_SP * atf.catalog_SP.validateOrderGuideItem_SP * atf.catalog_SP.reviewOrderGuideSummary_SP * atf.catalog_SP.reviewIteminOrderGuide_SP * atf.catalog_SP.addItemtoShoppingCart_SP * atf.catalog_SP.addOrderGuidetoShoppingCart_SP * atf.catalog_SP.submitOrderGuide_SP * atf.catalog_SP.submitRecordProducer_SP * atf.catalog_SP.orderCatalogItem_SP {#atf-test-object-now-ts__ul_gxm_cmp_ccc} |
| [Quick start tests for Dashboards](https://www.servicenow.com/docs/access?context=quick-start-tests-dashboards&version=yokohama&pubname=yokohama-now-intelligence&ft:locale=en-US)                                                                       | * atf.reporting.responsiveDashboard * atf.reporting.responsiveDashboardSharing {#atf-test-object-now-ts__ul_hxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Catégorie REST](https://servicenow-prod.fluidtopics.net/LnoeCqcCWSD6Zn9ASFFQaw#test-steps-rest-category "Vérifiez la fonctionnalité des appels REST.")                                                                                                                                          | * atf.rest.assertResponseJSONPayloadIsValid * atf.rest.assertXMLResponsePayloadElement * atf.rest.assertResponseXMLPayloadIsWellFormed * atf.rest.assertStatusCodeName * atf.rest.sendRestRequest * atf.rest.assertStatusCode * atf.rest.assertResponseTime * atf.rest.assertJsonResponsePayloadElement * en-tête atf.rest.assertResponseHeader * atf.rest.assertResponsePayload {#atf-test-object-now-ts__ul_ixm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Catégorie de serveur](https://servicenow-prod.fluidtopics.net/YAi687OFG8wS19VP6_DILA#test-steps-server-category "Effectuer des opérations côté serveur. Par exemple, interroger et mettre à jour un enregistrement, emprunter l’identité d’un utilisateur ou exécuter un script côté serveur.") | * atf.serveur.recordMettre à jour * atf.serveur.emprunter l'identité * atf.serveur.enregistrementValidation * atf.serveur.créerUtilisateur * atf.server.recordDelete * atf.server.log * atf.serveur.checkoutShoppingPanier * atf.serveur.requêteEnregistrement * atf.serveur.insertionenregistrement * atf.server.searchForCatalogItem * atf.server.replayRequestItem {#atf-test-object-now-ts__ul_jxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Catégorie Catalogue de services](https://servicenow-prod.fluidtopics.net/vjS8L63b9UCwkzJ2chOyqg#test-steps-service-catalog-category "Validez les transactions d’éléments de catalogue uniques ainsi que les flux de demandeurs et de prestataires dans Catalogue de services.")                 | * atf.catalog.addItemToShoppingCart * atf.catalog.validatePriceAndRecurringPrice * atf.catalog.openRecordProducer * atf.catalog.setCatalogItemQuantity * atf.catalog.orderCatalogItem * atf.catalog.openCatalogItem * atf.catalog.setVariableValue * atf.catalog.submitRecordProducer * atf.catalog.validateVariableValue * atf.catalog.variableStateValidation {#atf-test-object-now-ts__ul_kxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Catégorie de formulaire](https://servicenow-prod.fluidtopics.net/XIchnfXcpmuY4gWu29s2jg#test-steps-form-category "Validez la fonctionnalité des champs et des actions d’interface utilisateur sur un formulaire.")                                                                              | * atf.form.uiActionVisibility * atf.form.clickModalButton * atf.form.fieldValueValidation * atf.form.openNewForm * atf.form.openExistingRecord * atf.form.setFieldValue * atf.form.submitForm * atf.form.clickDeclarativeAction * atf.form.clickUIAction * atf.form.declarativeActionVisibility * atf.form.fieldStateValidation {#atf-test-object-now-ts__ul_lxm_cmp_ccc}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
[Tableau 2. Étapes de test]

{#atf-test-object-now-ts__table_uqw_2mp_ccc}

