google / google/EarlGrey

Cannot find in scope error

Open
#1,608 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

I followed the tutorial to setup Earlgrey in Xcode, things seems to be fine until I pasted the `Earlgrey.swift` and tried to run the sample code, Xcode threw the error of `Cannot find in scope error` for all the lines of code in the `Earlgrey.swift` ascwell for the sample code I tried running.

Please, what's the way forward. Thanks.
```
Swift Compiler Error Group
Cannot find 'grey_keyWindow' in scope
Cannot find 'grey_tap' in scope
Cannot find 'grey_sufficientlyVisible' in scope
```

The simple test code
```
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
EarlGrey.selectElement(with: grey_keyWindow()).perform(grey_tap())
.assert(grey_sufficientlyVisible())

// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
```

Screen Shot 2021-05-20 at 11 52 14 AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tutorial setup in Xcode, the pasted Earlgrey.swift file, and the sample UI test, then reproduce the reported compiler errors for grey_keyWindow, grey_tap, and grey_sufficientlyVisible. Done means the sample compiles and runs without the cannot-find-in-scope errors; the issue names no specific repository tests or additional files.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
mobile, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.