Forum Discussion

Lagencie's avatar
Lagencie
Frequent Contributor
2 years ago
Solved

NG-Translate hyphenation breaking contentText

Hello,  perhaps someone experienced the same problem already - we are using contentText quite often in our testsuite and the developers updated their code lately and they now used the ng-transla...
  • AlexKaras's avatar
    2 years ago

    Hi Dominik,

     

    Did I get it right that .contentText is used for text comparisons only and not for objects identification in NameMapping?

    If my understanding is correct, why not to create, say, TextUnhyphenate(strValue) function that will do exactly what your guys did for Cypress and wrap all calls to xxx.contentText with this function?

    E.g.:

    if (strValueFromDB == TextUnhyphenate(someUIobject.contentText)) {...}

    I think that you even can create a regular expression to wrap everything that ends with .contentText with a call to the function.

     

    Another possible option might be to use some other property that contains same value as .contentText but without hyphenation and use this property instead of .contentText.