Created
September 14, 2012 00:29
-
-
Save glennmartinez/3718958 to your computer and use it in GitHub Desktop.
capybara test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| require 'utils' | |
| class CalendarCreate | |
| def createcalendar(pagetitle) | |
| pagetitle = utilhelper.generate_random_name | |
| utilhelper = Utils.new | |
| click_link 'Add Page' | |
| click_button 'Next' | |
| find_field('content-title').click | |
| fill_in 'title', :with => pagetitle | |
| find('#wysiwygTextarea_ifr').click | |
| within_frame('wysiwygTextarea_ifr') do | |
| sleep 1 | |
| editor = page.find_by_id('tinymce') | |
| editor.native.send_keys('{') | |
| editor.native.send_keys('Team Calendar') | |
| end | |
| # puts find("#autocomplete-search-text") | |
| # puts find("Team Calendars") | |
| # puts page.body.inspect | |
| page.find(".autocomplete-macro-calendar").click | |
| page.find(".option-new").click | |
| # Select Events Calendar | |
| page.find(".subcalendar-type-local").click | |
| fill_in 'Name', :with => 'New Event Calendar' | |
| fill_in 'Description', :with => 'My Event Calendar' | |
| click_on 'OK' | |
| sleep 1 | |
| click_on 'Save' | |
| # how to get pageid<meta name="ajs-page-id" content="917608"> | |
| page.find(".plugin-calendar") | |
| end | |
| def insertsexitingcalendar() | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| require_relative '../../lib/pageobjects/teamcalendar/calendarcreate_spec' | |
| require 'utils' | |
| utilhelper = Utils.new | |
| pagetitle = utilhelper.generate_random_name | |
| include Capybara::DSL | |
| describe "create a calendar", :type => :request do | |
| it "logs in to confluence and creates a calendar" do | |
| visit base_url | |
| fill_in 'Username', :with => 'admin' | |
| fill_in 'Password', :with => 'admin' | |
| click_button 'Log In' | |
| pageobjectcalendar = CalendarCreate.new | |
| pageobjectcalendar.createpage(pagetitle) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment