Coypu 开源项目教程
coypuIntuitive, robust browser automation for .Net项目地址:https://gitcode.com/gh_mirrors/co/coypu
1. 项目的目录结构及介绍
Coypu 项目的目录结构如下:
coypu/
├── lib/
│ ├── coypu/
│ │ ├── browser.rb
│ │ ├── dsl.rb
│ │ ├── element_expectations.rb
│ │ ├── expectations.rb
│ │ ├── session.rb
│ │ └── ...
│ └── coypu.rb
├── spec/
│ ├── coypu_spec.rb
│ ├── browser_spec.rb
│ ├── session_spec.rb
│ └── ...
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
└── ...
目录结构介绍
lib/
:包含 Coypu 的核心代码文件。coypu/
:核心代码的子目录,包含多个 Ruby 文件,如browser.rb
、session.rb
等。coypu.rb
:主入口文件,加载所有核心功能。
spec/
:包含项目的测试文件,如coypu_spec.rb
、browser_spec.rb
等。Gemfile
和Gemfile.lock
:定义项目的依赖关系。LICENSE
:项目的许可证文件。README.md
:项目的说明文档。
2. 项目的启动文件介绍
Coypu 项目的启动文件是 lib/coypu.rb
。这个文件负责加载 Coypu 的所有核心功能模块。
require 'cucumber'
require 'selenium-webdriver'
require 'rspec/expectations'
require 'coypu/browser'
require 'coypu/dsl'
require 'coypu/element_expectations'
require 'coypu/expectations'
require 'coypu/session'
require 'coypu/options'
require 'coypu/drivers'
require 'coypu/driver'
require 'coypu/driver/selenium'
require 'coypu/driver/native'
require 'coypu/driver/rack_test'
require 'coypu/driver/browser_stack'
require 'coypu/driver/sauce_labs'
require 'coypu/driver/testingbot'
require 'coypu/driver/poltergeist'
require 'coypu/driver/webkit'
require 'coypu/driver/phantomjs'
require 'coypu/driver/chrome'
require 'coypu/driver/firefox'
require 'coypu/driver/ie'
require 'coypu/driver/edge'
require 'coypu/driver/safari'
require 'coypu/driver/opera'
require 'coypu/driver/remote'
require 'coypu/driver/local'
require 'coypu/driver/browser'
require 'coypu/driver/window'
require 'coypu/driver/element'
require 'coypu/driver/frame'
require 'coypu/driver/alert'
require 'coypu/driver/javascript'
require 'coypu/driver/location'
require 'coypu/driver/cookie'
require 'coypu/driver/file'
require 'coypu/driver/form'
require 'coypu/driver/link'
require 'coypu/driver/button'
require 'coypu/driver/field'
require 'coypu/driver/select'
require 'coypu/driver/checkbox'
require 'coypu/driver/radio'
require 'coypu/driver/textarea'
require 'coypu/driver/option'
require 'coypu/driver/table'
require 'coypu/driver/image'
require 'coypu/driver/area'
require 'coypu/driver/map'
require 'coypu/driver/object'
require 'coypu/driver/param'
require 'coypu/driver/embed'
require 'coypu/driver/audio'
require 'coypu/driver/video'
require 'coypu/driver/source'
require 'coypu/driver/track'
require 'coypu/driver/canvas'
require 'coypu/driver/svg'
coypuIntuitive, robust browser automation for .Net项目地址:https://gitcode.com/gh_mirrors/co/coypu