Skip to content

Commit

Permalink
start work for remove selenium (#172)
Browse files Browse the repository at this point in the history
* draft: start work for remove selenium

* refactored Login class for new login procedure

* fix processing invalid (expired) data - check

* raise exception if session expired

* version++, changelog, readme, test several version of ruby

* test only ruby3-latest

* nocov version file
  • Loading branch information
luk4s authored Jan 24, 2025
1 parent ffecb19 commit aa181b3
Show file tree
Hide file tree
Showing 27 changed files with 318 additions and 244 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Ruby

on: [push,pull_request]
on: [push, pull_request]

jobs:
spec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [3.2, 3.3, 3]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- uses: browser-actions/setup-firefox@latest
- name: Run tests
run: bundle exec rspec
run: bundle exec rspec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@

# rspec failure tracking
.rspec_status
.env
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3

Style/StringLiterals:
Enabled: true
Expand Down
45 changes: 30 additions & 15 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-03-01 20:32:36 UTC using RuboCop version 1.47.0.
# on 2025-01-24 16:50:34 UTC using RuboCop version 1.70.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'atrea_control.gemspec'

# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 34

# Offense count: 2
# Offense count: 3
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 21
Expand All @@ -28,36 +35,37 @@ RSpec/ExpectInHook:
Exclude:
- 'spec/atrea_control/duplex/unit_spec.rb'

# Offense count: 7
# Configuration parameters: EnforcedStyle.
# Offense count: 4
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Exclude:
- 'spec/atrea_control/duplex/login_spec.rb'
- 'spec/atrea_control/duplex/unit_spec.rb'
EnforcedStyle: receive

# Offense count: 2
# Offense count: 1
RSpec/MultipleExpectations:
Max: 3

# Offense count: 3
# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/ReceiveMessages:
Exclude:
- 'spec/atrea_control/duplex/unit_spec.rb'

# Offense count: 1
RSpec/StubbedMock:
Exclude:
- 'spec/atrea_control/duplex/login_spec.rb'
- 'spec/atrea_control/duplex/unit_spec.rb'

# Offense count: 6
# Offense count: 9
RSpec/SubjectStub:
Exclude:
- 'spec/atrea_control/duplex/login_spec.rb'
- 'spec/atrea_control/duplex/unit_spec.rb'
- 'spec/atrea_control/duplex/user_ctrl_spec.rb'

# Offense count: 4
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/atrea_control/duplex/login_spec.rb'
- 'spec/atrea_control/duplex/unit_spec.rb'
- 'spec/atrea_control/duplex/user_ctrl_spec.rb'

Expand All @@ -66,11 +74,18 @@ Security/Eval:
Exclude:
- 'lib/atrea_control/duplex/user_ctrl.rb'

# Offense count: 2
# Offense count: 3
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/atrea_control.rb'
- 'lib/atrea_control/logger.rb'

# Offense count: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Layout/LineLength:
Max: 238
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.4
3.3.6
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## [Unreleased]
## [3.0.0] - 2025-01-25
### Removed
- selenium-based login procedure
### Added
- token / phpsessionid-based login in background
- "session" validity check & expiration (exception)
### Changed
- ruby version 3.3+
-
## [2.2.0] - 2024-10-20
### Added
- timestamp from atrea server
### Changed
Expand Down
63 changes: 28 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
PATH
remote: .
specs:
atrea_control (2.3.0)
atrea_control (3.0.0)
i18n (~> 1.14)
nokogiri (~> 1.15)
rest-client (~> 2.1)
selenium-webdriver (~> 4.25.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
coderay (1.1.3)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.5)
crack (1.0.0)
bigdecimal
rexml
diff-lcs (1.5.1)
docile (1.4.1)
domain_name (0.6.20240107)
hashdiff (1.1.1)
hashdiff (1.1.2)
http-accept (1.7.0)
http-cookie (1.0.7)
http-cookie (1.0.8)
domain_name (~> 0.5)
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.7.5)
json (2.9.1)
language_server-protocol (3.17.0.3)
logger (1.6.1)
logger (1.6.5)
method_source (1.1.0)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.1001)
mime-types-data (3.2025.0107)
netrc (0.11.0)
nokogiri (1.17.2-arm64-darwin)
nokogiri (1.18.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-darwin)
nokogiri (1.18.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
nokogiri (1.18.2-x86_64-linux-gnu)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.5.1)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pry (0.15.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
regexp_parser (2.10.0)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.9)
rexml (3.4.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -74,45 +72,40 @@ GEM
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.68.0)
rspec-support (3.13.2)
rubocop (1.70.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-rspec (3.2.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
unicode-display_width (2.6.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.11)

PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-20
x86_64-linux

Expand All @@ -127,4 +120,4 @@ DEPENDENCIES
webmock (~> 3.14)

BUNDLED WITH
2.5.17
2.6.3
Loading

0 comments on commit aa181b3

Please sign in to comment.