-
Couldn't load subscription status.
- Fork 0
Sprint 13 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sprint 13 #5
Conversation
| func code(from url: URL) -> String? | ||
| } | ||
|
|
||
| class AuthHelper: AuthHelperProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь стоит указать его как final
| if segue.identifier == segueID { | ||
| guard | ||
| let webViewViewController = segue.destination as? WebViewViewController | ||
| else { fatalError("Failed to prepare for \(segueID)") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По своему опыту хотел бы отметить, что в продакшене не используют fatalError, советую заменить на assertionFailure.
| } | ||
|
|
||
| func logout(completion: @escaping () -> Void) { | ||
| authToken?.removeAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Данный вызов не удаляет токен, он присваивает authToken пустую строку, которая записывается в значениие токена, затем в SplashScreene у тебя идет проверка на nil, а пустая строка != nil.
Здесь стоит присваивать nil, в результате чего удалиться значение токена
| // func configure(_ presenter: WebViewPresenterProtocol) { | ||
| // self.presenter = presenter | ||
| // self.presenter?.view = self | ||
| // } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендую удалить в проекте лишний закомментированный код
| webView.navigationDelegate = self | ||
| webView.accessibilityActivate() | ||
| // configure(WebViewPresenter(authHelper: AuthHelper())) | ||
| presenter?.viewDidLoad() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для того, чтобы заработал ProgressBar здесь нужно присвоить значение estimatedProgressObservation:
estimatedProgressObservation = webView.observe(
.estimatedProgress,
options: [],
changeHandler: { [weak self] _ , _ in
guard let self else { return }
self.presenter?.didUpdateProgressValue(self.webView.estimatedProgress)
})
| } | ||
|
|
||
| override func viewWillAppear(_ animated: Bool) { | ||
| // rescaleAndCenterImageInScrollView(image: imageView.image!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не используется
| UIBlockingProgressHUD.show() | ||
| } else { | ||
| let storyboard = UIStoryboard(name: "Main", bundle: nil) | ||
| let authViewController = storyboard.instantiateViewController(withIdentifier: "AuthViewController") as! AuthViewController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендую сделать проверку через guard let
| } | ||
|
|
||
| private func switchToTabBarController() { | ||
| guard let window = UIApplication.shared.windows.first else { fatalError("Invalid Configuration") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендую заменить на assertionFailure
| let loginTextField = webView.descendants(matching: .textField).element | ||
| XCTAssertTrue(loginTextField.waitForExistence(timeout: 5)) | ||
| loginTextField.tap() | ||
| loginTextField.typeText("course.ios@artsofte.ru") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендую вынести в константы логины, пароли и оставить пустым
| } | ||
|
|
||
| func testProfile() throws { | ||
| app.tabBars.buttons.element(boundBy: 1).tap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендую делать поиск по идентификатору
No description provided.