{"id":21541652,"url":"https://github.com/concretesolutions/magneton","last_synced_at":"2025-04-10T04:23:42.622Z","repository":{"id":56882580,"uuid":"64878762","full_name":"concretesolutions/magneton","owner":"concretesolutions","description":"A simple gem to generate all files needed in a project that will support Cucumber, SitePrism, Capybara and Selenium.","archived":false,"fork":false,"pushed_at":"2018-11-17T13:19:30.000Z","size":251,"stargazers_count":17,"open_issues_count":5,"forks_count":10,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-24T05:43:35.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/magneton","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/concretesolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-03T20:55:55.000Z","updated_at":"2020-08-05T23:09:35.000Z","dependencies_parsed_at":"2022-08-21T00:20:10.557Z","dependency_job_id":null,"html_url":"https://github.com/concretesolutions/magneton","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretesolutions%2Fmagneton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretesolutions%2Fmagneton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretesolutions%2Fmagneton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concretesolutions%2Fmagneton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concretesolutions","download_url":"https://codeload.github.com/concretesolutions/magneton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248155766,"owners_count":21056699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T05:07:12.412Z","updated_at":"2025-04-10T04:23:42.603Z","avatar_url":"https://github.com/concretesolutions.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MAGNETON [![Circle CI](https://circleci.com/gh/concretesolutions/magneton.svg?style=shield)](https://circleci.com/gh/concretesolutions/magneton) [![Code Climate](https://codeclimate.com/github/concretesolutions/magneton.png)](https://codeclimate.com/github/concretesolutions/magneton) [![Test Coverage](https://codeclimate.com/github/concretesolutions/magneton/badges/coverage.svg)](https://codeclimate.com/github/concretesolutions/magneton/coverage) [![Issue Count](https://codeclimate.com/github/concretesolutions/magneton/badges/issue_count.svg)](https://codeclimate.com/github/concretesolutions/magneton) [![Gem Version](https://badge.fury.io/rb/magneton.svg)](https://badge.fury.io/rb/magneton)\n\nA simple gem to generate web automation project with:\n\n\u003e Cucumber [(link)](https://cucumber.io/)\n\n\u003e Capybara [(link)](https://github.com/jnicklas/capybara)\n\n\u003e SitePrism [(link)](https://github.com/natritmeyer/site_prism)\n\n\u003e Selenium Webdriver [(link)](http://www.seleniumhq.org/)\n\n The structure is based on three layers: features, steps and pages.\n\n1. Features: Contains all the features of the project;\n2. Steps: Contains all the steps implementations;\n3. Pages: Contains all the pages in the website. A page must contain the declaration of all the elements of the page and the declaration of its actions.\n\n## Instalation\n\nInstall it as:\n\n    $ gem install magneton\n\n## Usage\n\nIn the terminal, type for help:\n\n```\n  magneton\n```\n\nTo see the gem version type:\n\n```\n  magneton version\n```\n\nTo generate a project type:\n\n```\n  magneton new ProjectName\n```\n\n### Windows Caveats\n\n##### If you face encoding problems, type: #####\n```\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor] \"AutoRun\"=\"chcp 65001\"\n```\nThis command will ensure your terminal is always using Unicode.\n\n#### Localized Project Generation\nThis command will create a folder named ProjectName in the current directory and will create all the needed files. This gem support localizations. To create a localized project, in Portuguese, type:\n\n```\n  magneton new ProjectName --lang=pt\n```\n\n\u003e The default language is English ('en'). The elements of Gherkin such as Given, When, Then, And, Scenario will be translated to all Gherkin supported languages, but this gem has just a few translation files (see that in folder: `lib/magneton/locales`).\n\n  \u003e **MAGNETON doesn't support your mother language?** No problem. Fork it, create your yml translation file, uses the en.yml file as a template. Translate it and make a pull request. There are only 15 lines to be translated, this will take no time.\n\n  \u003e **Want to know how to name your translation yml file?** See the Gherkin supported languages [here](https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.json) for reference.\n\nOnce the project is created, open its folder (`cd ProjectName`) and run `bundle install`\n\nThere are three generators that are responsible to create the templates for Features, Step definitions and Pages.\n\n**The generators commands ONLY WORK in the ROOT FOLDER of the project.**\n\n#### Features\n\n```\n  magneton generate feature FeatureName\n```\nThe feature generator will create a feature and its files. So this command will create the FeatureName.feature file inside the folder `features/specifications`, the file FeatureName_steps.rb inside the folder `features/step_definitions`, the files FeatureName_page.rb inside the folder `features/pages`.\n\n#### Steps\n\n```\n  magneton generate step StepName\n```\nThe step generator will create a step file named StepName_steps.rb in the folder  `features/step_definitions`\n\n\n#### Pages\n\n```\n  magneton generate page PageName\n```\n\nThe page generator will create a page file named PageName_page.rb in the folder `features/pages`\n\n#### Helpers\n\nIn the file `features/support/helper.rb` you will find utilities to help your tests.\n\nImplemented so far:\n- take_screenshot\n- mouse_over\n- visual matching\n- crop screenshot\n\n##### Visual Matching\n\nYou can compare images using the `visual_matcher` method:\n`expect('imagem_atual').to visual_match('imagem_baseline')`\n\nYou can create the baseline_images if you include the tag `@create_baseline_image` on your scenarios.\n\n##### Crop screenshot\n\nYou can crop a screenshot around element, just only use  `take_screenshot_and_crop` method:\n`take_screenshot_and_crop(name_file, folder_to_save, css_selector)`\n\n## TODO\n\n1. Run tests in Remote Server\n2. Add more base methods using Selenium\n\n## Contributing\n\n1. Fork it ( https://github.com/concretesolutions/magneton )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcretesolutions%2Fmagneton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcretesolutions%2Fmagneton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcretesolutions%2Fmagneton/lists"}