Skip to content

Not getting accessibility errors in unit test #12

@aloksinha18

Description

@aloksinha18

Hi I have tried using this framework in swift project.
I have setup the test case like this

  override static func setUp() {
    super.setUp()
    // Put setup code here. This method is called before the invocation of each test method in the class.
   
    var gTXChecking : [GTXChecking] = []
    guard let checkForAXLabelPresent = GTXChecksCollection.checkForAXLabelPresent() else {
        fatalError("Fatal Error")
    }
    guard let checkForAXLabelNotPunctuated = GTXChecksCollection.checkForAXLabelNotPunctuated() else {
        fatalError("Fatal Error")
    }
    gTXChecking.append(checkForAXLabelPresent)
    let newCheck = GTXCheckBlock.gtxCheck(withName: "label don't have accessibility") { (element, error) -> Bool in
        
        if (element as AnyObject).accessibilityLabel == nil {
            return false
        }
        return true
    }
    gTXChecking.append(checkForAXLabelNotPunctuated)
    
    gTXChecking.append(newCheck)

   GTXiLib.install(on: GTXTestSuite(allTestsIn: self), checks: gTXChecking, elementBlacklists: [])
}

When I am running test cases it is not throwing any error(even if I have not set accessibility labels and text to UILable or UIButton.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions