You can use Preview mode to test most code on a site before publishing. You can perform actions in Preview mode that you would be able to perform on a live site. When testing a site, you can check if any errors appear in the Wix Developer Console.
Preview mode is available in Wix Studio and Wix Editor. If you're developing in the Wix IDE or the Local IDE, you can open a site in Wix Studio or Wix Editor to use Preview mode.
Although you can view pages and interact with a site and data in Preview mode, the site doesn't behave exactly as it does when published:
You can try out a test version of your published site on a small percentage of visitors using a test site. This is helpful for testing functionality that only works on a published site without exposing that functionality to all site visitors.
If you see errors or a site isn't running as expected, there are tools you can use to debug the code in the site.
When you've finished previewing and return to the editor, interactions you had with a site aren't maintained. The site returns to the state it was in before you entered Preview mode. The only exception is collection data. Changes you make to collection data in preview persist even after you exit Preview mode.