> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Test mode

> Add a test mode form to WEBSALE templates: password input field, debug activation and code to deactivate test mode for hidden shop previews.

# Form for entering the password

* Input mask for the test mode password
* Activating debug mode
* Deactivating test mode

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if not $wsTestMode.active }}

  {{ var $cActionTestModeOn = $wsActions.create("TestModeOn") }}

  {{ if $cActionTestModeOn.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeOn.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}

  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeOn.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeOn.id }}">
    <input type="hidden" name="wstarget" value="/">
    
    <input type="password" name="password" placeholder="Password">
    <label for="password">Password</label>
    
    <input type="checkbox" name="debug" value="on" {{ if $wsTestMode.debug }} checked{{ /if }}>
    <label class="form-check-label wsCursorPointer">Debug</label>
    
    <button name="wsact" value="{{= $cActionTestModeOn.id }}">Activate test mode</button>
  </form>
  
  {{ else}}
 
 {{ var $cActionTestModeOff = $wsActions.create("TestModeOff") }}
  
  {{ if $cActionTestModeOff.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeOff.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}
  
  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeOff.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeOff.id }}">
    <input type="hidden" name="wstarget" value="/">
    <button name="wsact" value="{{= $cActionTestModeOff.id }}">Deactivate test mode</button>
  </form>
 
 
{{ /if }}
```

# Change test mode

There is the option to end the test mode debugging function without ending the test mode at the same time.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if not $wsTestMode.active }}
  ...  
{{ else}}
  ...
  {{ var $cActionTestModeChange = $wsActions.create("TestModeChange") }}

  {{ if $cActionTestModeChange.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeChange.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}

  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeChange.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeChange.id }}">
    <input type="hidden" name="wstarget" value="/">

    <input type="checkbox" name="debug" value="on" {{ if $wsTestMode.debug }} checked{{ /if }}>
    <label>Debug</label>
    <button name="wsact" value="{{= $cActionTestModeChange.id }}">Apply setting</button>
  </form>
{{ /if }}
```


## Related topics

- [Editing content in Strapi](/en/strapi-cms/inhalte-anpassen-in-strapi.md)
- [TestMode](/en/frontend/referenz/aktionen/testmode.md)
- [$wsTestMode - Test mode](/en/frontend/referenz/module/wstestmode.md)
- [actions - Test mode](/en/konfiguration/actions-fehlertexte-e-mails/actions-testmodus.md)
- [Shop modes](/en/frontend/funktionsubersicht/inaktiv-seite.md)
