{"title":"System Tests","description":"","section":"guides/testing","version":"v1.5","path":"guides/testing/system-tests","canonical_url":"https://amberframework.org/docs/v1.5/guides/testing/system-tests","markdown_url":"https://amberframework.org/docs/v1.5/guides/testing/system-tests.md","inherited":true,"content_markdown":"# System Tests\n\n**Setting Up System Specs**\n\nWe have made it as simple as possible to have your system specs. Before running your specs ensure you have installed the `chromedriver` and that `selenium-server standalone` is in your system path.\n\n**Mac OS**\n\nYou can install the chromedriver and selenium standalone server with `brew`\n\n```bash\nbrew install selenium-server-standalone\nbrew install chromedriver\n```\n\nThis will install the chrome driver on the system path `/usr/local/bin/chromedriver`\n\nIf you're running in a different OS such as Linux you can specify the chromedriver path as such\n\n```crystal\nmodule GarnetSpec\n  DRIVER = :chrome\n  PATH = \"/usr/local/bin/chromedriver\"\nend\n```\n\nSystem tests allows test user interactions with your application, running tests in either a real chrome browser. System tests use the Selenium Standalone Server.\n\nFor creating Amber system tests, you use the spec/system directory in your application. Here's how a system test looks like:\n\n```crystal\nclass SomeFeature < GarnetSpec::System::Test\n  scenario \"user visits amber framework and sees getting started button\" do\n    visit \"http://www.amberframework.org\"\n    timeout 1000\n    click_on(:css, \"header a.btn.btn-primary\")\n    wait 2000\n    element(:tag_name, \"body\").text.should contain \"Introduction\"\n  end\n\n  scenario \"user visits amberframwork homepage and sees logo\" do\n    visit \"http://www.amberframework.org\"\n    wait 2000\n    element(:class_name, \"img-amber-logo\").attribute(\"src\").should match(\n      %r(https://www.amberframework.org/assets/img/amber-logo-t-bg.png)\n    )\n  end\nend\n```\n\nRun your specs with `crystal spec`\n\n{% hint style=\"warning\" %}\nSystem Test currently only work with the Chrome Browser\n{% endhint %}"}