草庐IT

chrome-custom-tabs

全部标签

ruby-on-rails - rails : Loading custom class from lib folder in controller

我创建了一个名为lib/services/my_service.rb的文件。#/lib/services/my_service.rbclassMyService...end我想在app/controllers/my_controller中使用它classMyController我收到一个错误消息,指出MyService是一个未初始化的常量。我尝试用导入它require'/lib/services/my_service.rb'但是我得到了cannotloadsuchfile--/lib/services/my_service.rb编辑:我尝试使用application.rb自动加载con

ruby - Chrome 的自定义配置文件

环境:MacOSX10.8.3、Ruby2.0.0p0、selenium-webdriver2.32.1、ChromeDriver26.0.1383.0。我想更改默认浏览器语言。我正在测试站点是否正确检测浏览器语言并以该语言显示页面。我能够将Firefox语言设置为德语:require"selenium-webdriver"profile=Selenium::WebDriver::Firefox::Profile.newprofile["intl.accept_languages"]="de"caps=Selenium::WebDriver::Remote::Capabilities.

ruby - Jekyll YAML 嵌套列表抛出错误 : found a tab character that violate intendation

这是我正在使用的列表。-name:Game1platforms:{win32,win64,linux64}distribution:-name:hereurl:null-name:desuraurl:http://www.desura.com/games/Game1source:https://github.com/name/Game1description:cg/games/Game1/description.htmlrelease:2013-06-23这是它抛出的错误:jekyll2.2.0|Error:(C:/Users/User/jekyll-site/_data/games.

ruby - 使用 Selenium 和 Ruby 将键盘快捷键发送到 chrome

我正在尝试使用键盘快捷键在Linux上的chrome浏览器中启动开发工具。因为我使用的是Ruby并且它没有和弦方法,所以我尝试了以下方法:driver.action.key_down(:shift).key_down(:control).send_keys("i").key_up(:shift).key_up(:control).perform以上代码将在Firefox中运行(如Keypressin(Ctrl+A)SeleniumWebDriver中所建议),但在chrome中,它返回nil但没有结果。有什么建议吗? 最佳答案 在我

ruby - 如何将 headless Chrome 与 capybara 和 Selenium 一起使用

Chrome版本:59.0.3071.104使用Cucumber、Capybara、Selenium通过HeadlessChrome实现自动化测试。features/support/env.rbrequire'rubygems'require'capybara/cucumber'Capybara.register_driver:selenium_chromedo|app|Capybara::Selenium::Driver.new(app,:browser=>:chrome,args:['headless'])endCapybara.default_driver=:selenium_c

ruby - 如何为 Chrome 构建远程 Webdriver

我正在尝试针对Chrome运行我的Selenium测试。当我在本地初始化驱动程序时:@driver=Selenium::WebDriver.for(:chrome)一切正常(我已经将Chrome二进制文件放在我的PATH中)但是当我尝试远程启动它时:@driver=Selenium::WebDriver.for(:remote,:url=>'http://'+SELENIUM_HOST+port+webdriver_hub,:desired_capabilities=>:chrome)出现以下错误Selenium::WebDriver::Error::UnhandledError:Th

ruby - Sinatra 不会在 Chrome 上通过重定向保持 session

Sinatra没有在Chrome上通过重定向保留我的session。它正在创建一个全新的session,我正在丢失我以前的所有session数据。举个例子(类似于theSinatradocs),我正在做这样的事情:enable:sessionsget'/foo'dosession[:user_id]=123session[:session_id]#"ABC",forexampleredirectto('/bar')endget'/bar'do#thisis"DEF"whenrespondingtoChrome(wrong),#but"ABC"whenrespondingtoFirefo

ruby - Firebase token 错误, "The custom token corresponds to a different audience."

我正在尝试在服务器上使用Ruby为Firebase生成JWTtoken。在3.0之前我们使用tokengenerator但升级后它停止工作。我用下面的代码得到的token给出了一个错误:Thecustomtokencorrespondstoadifferentaudience.我到处都找不到它的意思。private_key=OpenSSL::PKey::RSA.new谢谢 最佳答案 我也遇到了这个错误,我得到它是因为我使用了一个与firebase项目无关的服务帐户。在firebase项目下使用新key创建新服务帐户后,它开始工作。要

ruby-on-rails - rails : link_to calls custom method in controller

我希望使用link_to来调用我的Controller中的方法。但是,由于某些奇怪的原因,路由会寻找show方法。在我看来:..beverage.id)%>..在我的config/routes.rb中match'beverages/archive'=>'beverages#archive'在我的beverages_controller.rb中defarchivebeverage=Beverage.find(params[:id])respond_todo|format|#format.html#show.html.erbformat.json{renderjson:beverage}e

ruby - 卡皮斯特拉诺 3 : use server custom variable in task

我有多阶段多服务器设置,在我的任务中我需要使用服务器名称例如在stagin.rb我有:set:stage,:staging#Defineserversserver'xxx.xx.xx.xxx',user:'deploy',roles:%w{app},name:'app1'server'xxx.xx.xx.yyy',user:'deploy',roles:%w{app},name:'app2'我想在我的任务中使用那个“名称”变量:task:configuredoonroles(:app),in::paralleldo#howdoIgetservernamehere?endend