λλ κ³Όκ±°μ λ¬Έμ λ₯Ό μ΄ν΄ λ΄€κ³ , λ΄κ° μλ ν ν΄κ²°λμ§ μμ κ² κ°μ΅λλ€ (μ΄ λ¬Έμ λ λΉμ·ν΄ 보μ΄μ§λ§ λͺ¨λ λ«νμλ κ² κ°μ΅λλ€).
λ²μ μ 보 :
μ¬ν λ¨κ³ :
e2e.conf.coffee
)μ λ§λλλ€. Copied from https://github.com/angular/protractor/blob/master/docs/referenceConf.js
exports.config =
seleniumServerJar: null
seleniumPort: null
seleniumArgs: []
chromeOnly: true
seleniumAddress: null
sauceUser: null
sauceKey: null
sauceSeleniumAddress: null
specs: ["e2e/*.coffee"]
exclude: []
capabilities:
browserName: "chrome"
count: 1
shardTestFiles: false
maxInstances: 1
multiCapabilities: []
maxSessions: -1
baseUrl: "http://localhost:8081"
rootElement: "body"
allScriptsTimeout: 11000
getPageTimeout: 10000
framework: "jasmine"
jasmineNodeOpts:
isVerbose: true
showColors: true
includeStackTrace: true
defaultTimeoutInterval: 30000
e2e/spec.coffee
μμ λ€μ μ¬μμ λ§λλλ€. describe 'Page', () ->
it 'should debug properly', () ->
browser.get '/'
x = 'There is only X'
y = 1
z = ++y
browser.debugger()
protractor debug e2e.conf.coffee
μμ κ²°κ³Ό:
repl
λͺ¨λλ‘ λ€μ΄κ° λ³μμ μ‘μΈμ€ ν λ λ‘컬 λ²μμ λ³μμ μ‘μΈμ€ ν μ μμ΅λλ€.κ²°κ³Ό :
λΈλ μ΄ν¬ ν¬μΈνΈκ° μ€μ λμ΄ timers.js
, κ·Έλ¦¬κ³ μ΄μΈμ λ²μμ λͺ¨λ λ³μλ₯Ό μ‘μΈμ€ ν μ μμ΅λλ€ browser
:
protractor debug src/test/e2e.conf.coffee
Using ChromeDriver directly...
Hit SIGUSR1 - starting debugger agent.
debugger listening on port 5858
connecting... ok
break in timers.js:79
77 }
78
79 function listOnTimeout() {
80 var msecs = this.msecs;
81 var list = this;
debug> repl
Press Ctrl + C to leave debug repl
> x
ReferenceError: x is not defined
> y
ReferenceError: y is not defined
> z
ReferenceError: z is not defined
> browser
{ controlFlow: [Function],
schedule: [Function],
getSession: [Function],
getCapabilities: [Function],
quit: [Function],
...
}
μ μ΄κ²μ΄ νΌλ μ€λ¬μ΄μ§ μ΄ν΄νμ§λ§ μ€μ λ‘ μλ νλλ‘ μλν©λλ€. browser.debugger
μ it λΈλ‘μ λ²μ λ°μμ μΌμ μ€μ§νλ―λ‘ x, y λ° zλ μ€μ λ‘ μ μλμ§ μμ κ²μΌλ‘ μμλ©λλ€.
browser.debugger
κ° λ
ΈμΆλλ μ΄μ λ μ νν μ°λ¦¬κ° it λΈλ‘ λ΄μ μ€λ¨ μ μ μ€μ νκ³ μΆμ§ μκΈ° λλ¬Έμ
λλ€. λͺ
λ Ήμ΄ μ€νλ λ μ€κ°μ μ μ΄ νλ¦μ μ€μ νκ³ μΆκΈ° λλ¬Έμ
λλ€.
μ¬μ ν μ’μ μ€λλ debugger
λ₯Ό μ¬μ©νκ³ --debug
νλκ·Έλ‘ μ€ννμ¬ μ€μ λ‘ it λΈλ‘ λ΄μμ μΌμ μ€μ§ ν μ μμ΅λλ€.
μ’μ μ€λλ λλ²κ±°λ₯Ό μ¬μ©νκ³ --debug νλκ·Έμ ν¨κ» κ°λκΈ°λ₯Ό μ€νν΄λ μ€νμ΄ μΌμ μ€μ§λμ§ μμ΅λλ€. :-/
λλ체 μμ browser.debugger () λͺ¨λμ μμ μ 무μμ λκΉ? ν μ€νΈλ₯Ό λλ²κ·Ένμ§ μλ κ²½μ° ...
κ°μ₯ μ μ©ν λκΈ
λλ체 μμ browser.debugger () λͺ¨λμ μμ μ 무μμ λκΉ? ν μ€νΈλ₯Ό λλ²κ·Ένμ§ μλ κ²½μ° ...